Why doesn’t the “Help” button disappear?

Why doesn’t the “Help” button disappear?

I added the code to my plugin, but the “Help” button still hasn’t disappeared.

PLUGIN_SLOTS.add_items([
    (
        "all",
        "learning_help_slot",
        """
        {
          op: PLUGIN_OPERATIONS.Hide,
        }
        """
    )
])

image
This is not related to plugin installation or anything like that, because this code works:

PLUGIN_SLOTS.add_items([
    (
        "all",
        "course_info_slot",
        """
        {
          op: PLUGIN_OPERATIONS.Insert,
          widget: {
            id: 'custom_before_course_info_component',
            type: DIRECT_PLUGIN,
            priority: 10,
            RenderWidget: () => (
              <h3 style={{
                marginTop: 'auto',
                marginBottom: 'auto',
                marginRight: '0.5rem',
              }}>🌜</h3>
            ),
          },
        }
        """
    ),
    (
        "all",
        "course_info_slot",
        """
        {
          op: PLUGIN_OPERATIONS.Insert,
          widget: {
            id: 'custom_after_course_info_component',
            type: DIRECT_PLUGIN,
            priority: 90,
            RenderWidget: () => (
              <h3 style={{
                marginTop: 'auto',
                marginBottom: 'auto',
                marginLeft: '0.5rem',
              }}>🌛</h3>
            ),
          },
        }
        """
    )
])

Overall, the Hide operation doesn’t seem to work quite correctly.

Are you following the instructions from Customizing Site Header Using Frontend “Slots” — Latest documentation?

HI @sarina
Yes, I’m following the instructions and everything is working for me. For example, I was able to add emojis before and after the text for the course_info_slot (frontend-component-header/src/plugin-slots/CourseInfoSlot at v5.7.1 · openedx/frontend-component-header · GitHub). However, the Hide operation doesn’t work in my case.

Here is my code. Everything works for course_info_slot, but it doesn’t work for learning_help_slot.

Edit:


Modify operation is also working

result:

Edit2 and solution:Okay, I figured out what the mistake was – I just needed to add widgetId: 'default_contents'.

I’m glad it worked out!

In the future when posting code, could you post it in a formatted code block as opposed to images? That will enable people to search your code.

If you click this button:
image
you’ll get a space to enter in a formatted code block which will preserve spacing:

def my_function(var):
   print(var)

I edited your original post so you can see how it looks.

1 Like