Skip to content

Instantly share code, notes, and snippets.

@craigtommola
Last active April 16, 2019 17:32
Show Gist options
  • Save craigtommola/8d264cacb9c8371b0e705c38cdea26b5 to your computer and use it in GitHub Desktop.
Save craigtommola/8d264cacb9c8371b0e705c38cdea26b5 to your computer and use it in GitHub Desktop.
OUTC19: Bonus Tracks
<!-- This is an example, based on the use of the Hope College "Expand All Accordions" Asset -->
<!-- The concept is "If the PCF file contains specific content, then output a link to CSS file on publish." -->
<!-- This is the asset content -->
<div class="expand-button-wrapper">
<button id="expandAll" class="expand-all"><span class="expand-all-button-icon">&nbsp;</span> <span class="expand-button-text">Expand All</span></button>
</div>
<!-- Add to your /_resources/xsl/common.xsl or equivalent file, just before the closing </head> tag -->
<xsl:if test="/document/ouc:div[@label='maincontent']/descendant::button[@id='expandAll']”>
<link rel="stylesheet" type="text/css" href="{{f:12345678}}"/>
</xsl:if>
<!-- Add to your /_resources/xsl/_shared/ouvariables.xsl or equivalent file -->
<xsl:param name="ou:custom-headcode-css" />
<!-- Add to your /_resources/xsl/common.xsl or equivalent file -->
<xsl:if test="string-length($ou:custom-headcode-css) gt 1">
<link rel="stylesheet" type="text/css" href="{$ou:custom-headcode-css}"/>
</xsl:if>
<!--
Then "Create New Variable” in parent directory Access Settings
Name it 'custom-headcode-css' with the value of /path/to/your/stylesheet.css
All pages in directory will load CSS file before the closing </head>
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment