We're in the middle of some fast-moving changes to the Forem Admin experience, so we've paused documentation updates for the time being. You may find that the docs are now outdated in parts. If you have any questions, please visit forem.dev to request additional support. We thank you for your patience and hope you're liking the changes!
HTML Variants are HTML/CSS designs that are included in different areas of the platform. The most popular use of HTML Variants are as banner designs for the homepage banner. HTML Variants are versatile and will change between multiple variants if set for one location.
You can filter variants by:
- Leaderboard (published & approved)
- Mine (variants you have created)
- Admin (all variants, included unpublished and unapproved)
- Article show below article CTA (variants set to appear below each post)
- Badge Landing Page (variants set specifically to appear on
- Campaign (variants set to appear on the homepage banner)
#Steps to Create a New HTML Variant
To create an HTML variant, navigate to
/admin/customization/html_variants and click "New HTML Variant".
Fill the form with the following:
- Name: A descriptive name of your HTML Variant (i.e. GithHub Actions Campaign Banner)
- Group: Select which area you'd like this variant to appear.
- Target Tag: This is applicable for 'article show below article CTA' variants only. For example, a call-to-action for anything related to a tag that you'd like to appear under posts with that tag.
- HTML: This is where you can include the HTML and CSS of your design.
- For campaigns: Please see the code below to reference the proper classes and ids to use to ensure your banner functions appropriately.
- Published: Set published: true when your variant is ready to be used.
- Approved: An admin needs to set approved:true in order for your variant to go live.
The 'fork' button allows you to quickly duplicate an existing HTML Variant to make adjustments to your own version. The 'preview' button gives you a sense of what your variant will look like once it's published and approved.
NOTE: In order to publish your HTML Variant, you must navigate to
/admin/customization/config and click on "Campaign". You then must enter the name of your HTML Variant into "Campaign hero HTML variant name" and save the update.
#Example HTML Variant
Below is an example of an HTML Variant that results in this banner: