This component will allow you to add “category previews” to your categories page so users are able to see that a category exists without having access to the actual category. The preview looks like a standard category, but can link to a specified page where a user can be educated on how to gain access.
I’ve included a simple example below, but there are many different ways this component can be configured. Please be sure to read all of the information included in the Theme Settings.
Theme Creator Demo
You will need to be logged into an account here on Meta for this to work
Navigate to https://theme-creator.discourse.org and log-in using the button in the header if you are not already logged-in
Use the following link to activate the preview of this component: https://theme-creator.discourse.org/theme/tshenry/category-previews
Scroll down the category list until you find the “restricted category preview” category and attempt to enter it:
You will be taken to a published page with instructions on how to proceed to access the category:
I did my best to explain how this component works in the theme settings. The setup is not the most intuitive experience so feel free to ask questions and I will update the instructions to provide clarity.
I imagine there will be many different edge use-cases. I can’t guarantee that I can make this component work with all of them, but feedback and suggestions are welcome :slight_smile: Here are some things to keep in mind:
- Currently this will not work with the boxed categories styles. If there are enough requests, I can see about adding support
- There are
above-$CATEGORYclasses added to the previews that appear above a specific category. This can be used to add additional styling.
- This will not work with sub-categories displayed on the categories page
- Staff users and anonymous users will always see the category previews.
- Pay special attention to the IMPORTANT notes in the Theme Settings
This requires core changes that were added in commit
a3e8124. Please make sure you have updated your site recently enough to have picked it up.