Last active
December 15, 2015 11:58
-
-
Save uniquelau/5256385 to your computer and use it in GitHub Desktop.
Snippet of GetTemplate, that loads Umbraco content into an XML based template.
This file contains hidden or 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
<!-- Process <content /> --> | |
<xsl:template match="content"> | |
<!-- Process the $currentPage and load it's RTE, etc --> | |
<xsl:apply-templates select="$currentPage[current()/@position = 1]" mode="content"> | |
<xsl:with-param name="position" select="@position" /> | |
</xsl:apply-templates> | |
<!-- When the template has more than 1 content block, look inside the /Callouts folder--> | |
<xsl:if test="@position > 1"> | |
<!-- Handle sub content blocks, these could be RTE's, Link Groups, Widgets, Video's --> | |
<xsl:apply-templates select="$currentPage/Callouts/* [@isDoc][position() = current()/@position - 1]" mode="content"> | |
<!-- Note we -1 from position, because we are now inside a folder, so we start from 1 again. --> | |
<xsl:with-param name="position" select="@position" /> | |
</xsl:apply-templates> | |
</xsl:if> | |
<xsl:text> </xsl:text> | |
</xsl:template> |
This file contains hidden or 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
<!-- Template fragements stored as XML inside Umbraco --> | |
<div class="columnswrap layoutcols2"> | |
<div class="col1"> | |
<content class="innercontent" position = "1" /> | |
</div> | |
<div class="col2> | |
<content class="innercontent" position = "2" /> | |
</div> | |
<aside> | |
<comments actions="list,create" /> | |
</aside> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment