PageSourceSearch

https://forem-admin.netlify.app/assets/js/3371c4ca.cdfa69aa.js

js forem-admin.netlify.app collected 2026-10-03 10:45:22 UTC 11,880 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkforem_admin=self.webpackChunkforem_admin||[]).push([[5094],{3905:function(e,n,a){a.d(n,{Zo:function(){return c},kt:function(){return h}});var t=a(7294);function i(e,n,a){return n in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function o(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),a.push.apply(a,t)}return a}function r(e){for(var n=1;n<arguments.length;n++){var a=null!=arguments[n]?arguments[n]:{};n%2?o(Object(a),!0).forEach((function(n){i(e,n,a[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):o(Object(a)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(a,n))}))}return e}function s(e,n){if(null==e)return{};var a,t,i=function(e,n){if(null==e)return{};var a,t,i={},o=Object.keys(e);for(t=0;t<o.length;t++)a=o[t],n.indexOf(a)>=0||(i[a]=e[a]);return i}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(t=0;t<o.length;t++)a=o[t],n.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}var p=t.createContext({}),l=function(e){var n=t.useContext(p),a=n;return e&&(a="function"==typeof e?e(n):r(r({},n),e)),a},c=function(e){var n=l(e.components);return t.createElement(p.Provider,{value:n},e.children)},m={inlineCode:"code",wrapper:function(e){var n=e.children;return t.createElement(t.Fragment,{},n)}},d=t.forwardRef((function(e,n){var a=e.components,i=e.mdxType,o=e.originalType,p=e.parentName,c=s(e,["components","mdxType","originalType","parentName"]),d=l(a),h=i,u=d["".concat(p,".").concat(h)]||d[h]||m[h]||o;return a?t.createElement(u,r(r({ref:n},c),{},{components:a})):t.createElement(u,r({ref:n},c))}));function h(e,n){var a=arguments,i=n&&n.mdxType;if("string"==typeof e||i){var o=a.length,r=new Array(o);r[0]=d;var s={};for(var p in n)hasOwnProperty.call(n,p)&&(s[p]=n[p]);s.originalType=e,s.mdxType="string"==typeof e?e:i,r[1]=s;for(var l=2;l<o;l++)r[l]=a[l];return t.createElement.apply(null,r)}return t.createElement.apply(null,a)}d.displayName="MDXCreateElement"},73:function(e,n,a){a.r(n),a.d(n,{default:function(){return c},frontMatter:function(){return r},metadata:function(){return s},toc:function(){return p}});var t=a(7462),i=a(3366),o=(a(7294),a(3905)),r={description:"A high-level overview of the most important Forem features.",sidebar_position:0},s={unversionedId:"advanced-customization/html-variants",id:"advanced-customization/html-variants",isDocsHomePage:!1,title:"HTML Variants",description:"A high-level overview of the most important Forem features.",source:"@site/docs/advanced-customization/html-variants.md",sourceDirName:"advanced-customization",slug:"/advanced-customization/html-variants",permalink:"/docs/advanced-customization/html-variants",editUrl:"https://github.com/forem/admin-docs/edit/main/docs/advanced-customization/html-variants.md",version:"current",sidebarPosition:0,frontMatter:{description:"A high-level overview of the most important Forem features.",sidebar_position:0},sidebar:"tutorialSidebar",previous:{title:"Listings",permalink:"/docs/advanced-customization/extensions/listings"},next:{title:"Reports",permalink:"/docs/advanced-customization/reports"}},p=[{value:"Overview",id:"overview",children:[]},{value:"Steps to Create a New HTML Variant",id:"steps-to-create-a-new-html-variant",children:[]},{value:"Example HTML Variant",id:"example-html-variant",children:[]}],l={toc:p};function c(e){var n=e.components,a=(0,i.Z)(e,["components"]);return(0,o.kt)("wrapper",(0,t.Z)({},l,a,{components:n,mdxType:"MDXLayout"}),(0,o.kt)("div",{className:"admonition admonition-important alert alert--info"},(0,o.kt)("div",{parentName:"div",className:"admonition-heading"},(0,o.kt)("h5",{parentName:"div"},(0,o.kt)("span",{parentName:"h5",className:"admonition-icon"},(0,o.kt)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"},(0,o.kt)("path",{parentName:"svg",fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"}))),"important")),(0,o.kt)("div",{parentName:"div",className:"admonition-content"},(0,o.kt)("p",{parentName:"div"},"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 ",(0,o.kt)("a",{parentName:"p",href:"https://forem.dev"},"forem.dev")," to request additional support. We thank you for your patience and hope you're liking the changes!"))),(0,o.kt)("h2",{id:"overview"}
1,"Overview"),(0,o.kt)("p",null,"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."),(0,o.kt)("p",null,"You can filter variants by:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"Leaderboard (published & approved)"),(0,o.kt)("li",{parentName:"ul"},"Mine (variants you have created)"),(0,o.kt)("li",{parentName:"ul"},"Admin (all variants, included unpublished and unapproved)"),(0,o.kt)("li",{parentName:"ul"},"Article show below article CTA (variants set to appear below each post)"),(0,o.kt)("li",{parentName:"ul"},"Badge Landing Page (variants set specifically to appear on ",(0,o.kt)("inlineCode",{parentName:"li"},"/badge"),")"),(0,o.kt)("li",{parentName:"ul"},"Campaign (variants set to appear on the homepage banner)")),(0,o.kt)("h2",{id:"steps-to-create-a-new-html-variant"},"Steps to Create a New HTML Variant"),(0,o.kt)("p",null,"To create an HTML variant, navigate to ",(0,o.kt)("inlineCode",{parentName:"p"},"/admin/customization/html_variants"),' and click "New HTML Variant".'),(0,o.kt)("p",null,"Fill the form with the following:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"Name: A descriptive name of your HTML Variant ","(","i.e. GithHub Actions Campaign Banner",")"),(0,o.kt)("li",{parentName:"ul"},"Group: Select which area you'd like this variant to appear."),(0,o.kt)("li",{parentName:"ul"},"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."),(0,o.kt)("li",{parentName:"ul"},"HTML: This is where you can include the HTML and CSS of your design.",(0,o.kt)("ul",{parentName:"li"},(0,o.kt)("li",{parentName:"ul"},"For campaigns: Please see the code below to reference the proper classes and ids to use to ensure your banner functions appropriately."))),(0,o.kt)("li",{parentName:"ul"},"Published: Set published: true when your variant is ready to be used."),(0,o.kt)("li",{parentName:"ul"},"Approved: An admin needs to set approved:true in order for your variant to go live.")),(0,o.kt)("p",null,"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."),(0,o.kt)("p",null,"NOTE: In order to publish your HTML Variant, you must navigate to ",(0,o.kt)("inlineCode",{parentName:"p"},"/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.'),(0,o.kt)("h2",{id:"example-html-variant"},"Example HTML Variant"),(0,o.kt)("p",null,"Below is an example of an HTML Variant that results in this banner:"),(0,o.kt)("p",null,(0,o.kt)("img",{parentName:"p",src:"https://user-images.githubusercontent.com/16007075/121434737-c339b000-c94b-11eb-90f5-ef95d5edb9cc.png",alt:"Example HTML Variant"})),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-text"},'<style>\n  .campaignmode-hackathon {\n    border-radius: 9px;\n    background: white;\n    margin: 20px auto;\n    color: #0D122B;\n    max-width: 1440px;\n    width: 96%;\n    font-family:  -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, Helvetica,\n      Arial, sans-serif, \'Apple Color Emoji\', \'Segoe UI Emoji\', \'Segoe UI Symbol\';\n    padding-bottom: 30px;\n    position: relative;\n    border: 2px solid #dfe3e6;\n    box-shadow: 2px 2px 2px #dfe3e6;\n  }\n\n  .campaignmode-hackathon--first {\n    width: 50%;\n    display: inline-block;\n    margin-left: 10%;\n  }\n\n  .campaignmode-hackathon--second {\n    width: 30%;\n    display: inline-block;\n  }\n\n  .campaignmode-hackathon img.campaignmode-hackathon--mainimage {\n    width: 380px;\n    height: 156px;\n    max-width: 90%;\n    margin-top: 25px;\n    margin-left: -25px;\n  }\n\n  .campaignmode-hackathon .campaignmode-hackathon--clipart {\n    width: 380px;\n    vertical-align: -38px;\n  }\n\n  .campaignmode-hackathon h1 {\n    margin: -5px auto 3px;\n    font-size: 50px;\n    font-weight: 900;\n  }\n\n  .campaignmode-hackathon h2 {\n    margin: 20px auto 20px;\n  }\n\n  .campaignmode-hackathon h3 {\n    margin: 10px 0px 1px;\n    font-size: 32px;\n    max-width: 90%;\n    font-weight: 500;\n  }\n\n  .campaignmode-hackathon a {\n    background: rgb(59, 73, 223);\n    text-decoration: none;\n    padding: 12px 25px;\n    border-radius: 3px;\n    color: #f9f9f9;\n    font-size: 34px;\n    display: inline-block;\n    max-width: 80%;\n  }\n\n  .campaignmode-hackathon .closebutton {\n    position: absolute;\n    right: 18px;\n    top: 0px;\n    color: #0D122B;\n    background: transparent;\n    border: 0px;\n    font-size: 45px;\n    cursor: pointer;text-align: right;padding: 0px;\n  }\n\n  @media screen and (max-width: 1200px) {\n    .campaignmode-hackathon--clipart {\n      width: 80%;\n      vertical-align: -18px !important;\n    }\n  }\n\n  @media screen and (max-width: 800px) {\n     .campaignmode-hackathon {\n       border-radius: 0px;\n       width: 80%;\n       font-size: 0.9em;\n  }\n\n    .campaignmode-hackathon--first {\n      width: 90%;\n      margin-left: 5%;\n    }\n\n    .campaignmode-hackathon img.campaignmode-hackathon--mainimage {\n      width: 304px;\n      height: 124px;\n    }\n\n    .campaignmode-hackathon--second {\n      display: none;\n    }\n\n    .campaignmode-hackathon a {\n      font-size: 25px;\n      width: 100%;\n    }\n    .campaignmode-hackathon h3 {\n      font-size: 20px;\n    }\n  }\n\n</style>\n\n<div class="campaignmode-hackathon">\n  <div class="campaignmode-hackathon--first">\n    <img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bSAG7XjP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/oxwqc6bgjb494hzlauiz.png" class="campaignmode-hackathon--mainimage">\n    <h1>\n<img src="https://res.cloudinary.com/practicaldev/image/fetch/s--a4_6tQ0n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_420/https://github.githubassets.com/images/modules/site/features/actions-icon-actions.svg" style="vertical-align: -2px;width:42px;height:42px;"> Actions Hackathon</h1>\n    <h3><span>Cash prizes and more!</span></h3>\n    <h2><a href="https://dev.to/devteam/announcing-the-github-actions-hackathon-on-dev-3ljn">Start Building Now</a></h2>\n    <button class="closebutton" id="js-hero-banner__x">\xd7</button>\n  </div>\n  <div class="campaignmode-hackathon--second">\n    <img class="campaignmode-hackathon--clipart" src="https://res.cloudinary.com/practicaldev/image/fetch/s--gJgLqhKQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_420/https://dev-to-uploads.s3.amazonaws.com/i/z9y92jq4rn68ssaemohm.png">\n  </div>\n</div>\n')))}c.isMDXComponent=!0}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.