![]() |
Summary | Hides the lock badge icon for selected secure categories and chat channels |
![]() |
Repository | https://github.com/Lillinator/hide-lock-badge-icon |
![]() |
Install Guide | How to install a theme or theme component |
![]() |
New to Discourse Themes? | Beginner’s guide to using Discourse Themes |
Install this theme component
This simple theme component allows for hiding the lock badge icons for selected secure categories in the drop-down category selectors, header breadcrumbs, navigation sidebar menu, search results, and corresponding category chat channels. There is also an option for toggling for Staff, since seeing the lock icon can be a useful indicator for Staff members.
In the theme’s categories and channels field setting, use the category slug and category ID of each secure category (and chat channel) you want to hide the lock icon for, where the URL of the category is your-forum-address/c/category-slug/ID
(you can look in your browser’s address bar from the secured category). Separate the category slug and ID with a semicolon. Leave this blank to hide the lock icon for all secured categories.
For example, https://exampleforum.org/c/vip/6
would have category slug “vip” and category ID = 6 and in the setting category field you would input “vip;6” as one of the list items. Chat channel must be linked to the category and channel slug must be the same as its corresponding category. (See screenshots below)
For sub-categories, the sub-category will inherit the parent category if the latter is hidden. However, you can a hide lock icon in secure sub-categories themselves by separating the parent category and sub-category slugs with a forward slash like parentcategory-slug/subcategory-slug
(ie: boats/motorboats/8
) and use the sub-category ID in the settings field, separated by a semicolon, like category/subcategory;subcategoryID
.
Screenshots
To-do: Use category list_type setting!
Thanks to @nathank
, @Arkshine
and @Don
for some of the code snippets, and thanks to @awesomerobot
for fixes and being awesome