Last active
February 5, 2024 17:44
-
-
Save bearduk/ba48ffad675b70ccd7bb44022713ba9a to your computer and use it in GitHub Desktop.
k- Banner Standard t4 programmable layout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
importClass(com.terminalfour.publish.utils.BrokerUtils); // this is so that you can process t4tags | |
importPackage(com.terminalfour.template); | |
importPackage(com.terminalfour.sitemanager); | |
var chosenFormatterTag = '<t4 type="content" name="Choose variant" output="normal" modifiers="" />'; // update tag info | |
var chosenFormatter = BrokerUtils.processT4Tags (dbStatement, publishCache, section, content, language, isPreview, chosenFormatterTag); | |
var tid = content.getTemplateID(); | |
var tempManager = com.terminalfour.template.TemplateManager.getManager(); | |
var formatter = chosenFormatter; | |
var format = tempManager.getFormat(dbStatement,tid,formatter); //bring back an object of this template | |
var formatString = format.getFormatting(); //render the content on that object | |
document.write(com.terminalfour.publish.utils.BrokerUtils.processT4Tags(dbStatement, publishCache, section, content, language, isPreview, formatString)); | |
} catch(err){ | |
document.write(err); | |
// this is just to output any processing errors, it can be commented out while in production | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="module banner align-centre"> | |
<t4 type="fix-url" element="Variant 1: Optional URL link" /> | |
<picture> | |
<source srcset="<t4 type="content" name="Image 1600x600" output="file" modifiers"htmlentities" />" media="(min-width: 480px)"/> | |
<source srcset="<t4 type="content" name="Image 480x180" output="file" modifiers"htmlentities" />"> | |
<img src="<t4 type="content" name="Image 1600x600" output="file" modifiers"htmlentities" />" alt="<t4 type="content" name="Image alt text" output="normal" modifiers="striptags" />"> | |
</picture> | |
<!-- Captions start --> | |
<t4 type="content" output="selective-output" process-format="true" modifiers="" name="Variant 1: Lead caption" format="<div class="inner"> | |
<div class="banner__content"> | |
<p class="kcaption"> | |
<span class="kcaption__lead">$value</span> | |
<span class="kcaption__text"><t4 type="content" name="Variant 1: Caption text" output="normal" modifiers="striptags" /></span> | |
</p> | |
" /> | |
<!-- Selective link --> | |
<t4 type="content" output="selective-output" process-format="true" modifiers="medialibrary, nav_sections" name="Variant 1: Optional Section link" format="<a href="<t4 type="content" name="Variant 1: Optional Section link" output="linkurl" />" class=" link-arrow"> | |
<t4 type="content" name="Variant 1: Link text" output="normal"/> <svg viewBox="0 0 16 16" width="16" height="16" class="icon-arrow"><path d="M7.2 12.73l-1.41-1.41 3.29-3.29-3.29-3.29L7.2 3.32l4.71 4.71-4.71 4.7z"></path></svg></a>" /> | |
<!-- or URL link --> | |
<t4 type="content" output="selective-output" process-format="true" modifiers="medialibrary, nav_sections" name="Variant 1: Optional URL link" format="<a href="<t4 type="content" name="Variant 1: Optional URL link" output="normal" />" class=" link-arrow"> | |
<t4 type="content" name="Variant 1: Link text" output="normal"/> <svg viewBox="0 0 16 16" width="16" height="16" class="icon-arrow"><path d="M7.2 12.73l-1.41-1.41 3.29-3.29-3.29-3.29L7.2 3.32l4.71 4.71-4.71 4.7z"></path></svg></a>" /> | |
<!-- Caption close divs --> | |
<t4 type="content" output="selective-output" process-format="true" modifiers="" name="Variant 1: Lead caption" format="</div> | |
</div>" /> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="module banner align-centre"> | |
<picture> | |
<source srcset="<t4 type="content" name="Image 1600x600" output="file" modifiers"htmlentities" />" media="(min-width: 480px)"/> | |
<source srcset="<t4 type="content" name="Image 480x180" output="file" modifiers"htmlentities" />"> | |
<img src="<t4 type="content" name="Image 1600x600" output="file" modifiers"htmlentities" />" alt="<t4 type="content" name="Image alt text" output="normal" modifiers="striptags" />"> | |
</picture> | |
<t4 type="content" output="selective-output" process-format="true" modifiers="" name="Variant 2: Shield text" format="<div class="inner"> | |
<div class="hero-shield"> | |
<div class="fact-card shield"> | |
<div class="shield__content"> | |
<p class="fact-card__content"> | |
<span class="fact-card__large">$value</span> | |
<svg class="svg-icon " width="48px" height="48px"> | |
<use xlink:href="/media/svg/sprite.svg#icon-rosette"></use> | |
</svg> | |
</p> | |
</div> | |
</div> | |
</div> | |
</div>" /> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment