Widget Settings

When installing and setting up your widget(s) you need to determine how you want them to behave. Their behaviour is governed by their settings in yoursite.com/admin/layouts/widgets. Let’s go through each of them.

Position

This setting determines where the widget appears on the page. Currently there are only two options, “left” and “right”, which relate to the left and right sidebars. More positions may be added over time.

Order

Order determines the order widgets appear, within a common position, e.g. the order of the widgets in the left sidebar. You can use numbered positions, or “start” and “end” for dynamic positioning (e.g. if some widgets do not appear in certain contexts).

If widgets have the same order value, their order will be determined by the order they appear in /admin/layouts/widgets, however we do not recommend you rely on this. If you want to ensure a specific order, make sure this is represented in the order settings of the relevant widgets.

Context

Context is an “inclusive” setting that must be used for all widgets. You must select the contexts you want the widget to appear in. The “contexts” are the 4 main user-facing contexts in Discourse:

  • Topic List
  • Topic
  • Profile
  • Tags

Filter

Filter is an “exclusive” setting that, if used, restricts the widget to the specified filter(s). If you want the widget to appear for all filters leave this blank. The filters are:

  • Latest
  • Unread
  • New
  • Top
  • Read
  • Posted
  • Bookmarks
  • Categories

The categories homepage is arguably more of a “context” than a “filter”, but it is easier from a technical perspective to make it a filter. It is a unique aspect of the Discourse taxonomy.

Groups

Group is an “exclusive” setting that, if used, restricts the widget to the specified group(s). If you want the widget to appear for all groups leave this blank.

Categories

Categories is an “exclusive” setting that, if used, restricts the widget to the specified categories. If you want the widget to appear in all topic lists, regardless of category, leave this blank.

You can also specify “all categories”, which relates to the topic lists with all categories (shown as “all categories” in the Discourse category selector).

What about the users that do not belong to any group? Such as not logged in users.

After updating to the latest my custom HTML layout is not appearing in incognito mode, but appears fine when I am logged in. I suspect this field may be the culprit.

Could you share a screenshot of your settings? This works fine for the category list widget on thepavilion.io for example. These are our settings.

Ah, never mind. It must have been some sort of caching issue on Discourse’s end. Now that I checked in a private window, the custom widget appears just fine.

Please feel free to delete my posts if you intend to keep this topic as documentation only. And thanks for your quick response. :slightly_smiling_face:

1 Like

@angus
may I ask one quick question:
if I leave this blank, will “all categories” and “Uncategorized” be shown in the category list?

Is this a question about what categories will appear in the category list of the Category List Widget? (i.e. like the list on the left side on thepavilion.io) If so, these settings don’t affect that. These settings only affect which categories the widget appears in.

I just want "all categories“ could appear on the left sidebar 。
I think you may have answered my question:

thank you so much