Greystate XSLT Helpers
Miscellaneous XSLT files for use as included stylesheets to ease certain common tasks.
Hopefully, using these helpers you should be able to keep your XSLT clean and readable, with a focus on the logic that's part of your app, not worrying too much about the common functionality stuff that these provide.
helperssubfolder in the
distfolder, and put it alongside your other XSLT files (i.e., in the
xsltfolder if you're using Umbraco).
- The files in the
configfolder should go into the
configfolder of your Umbraco installation.
Using these helpers usually just require the same 2 steps:
Include the file(s) in your main XSLT file using the include instruction:
<xsl:include href="helpers/_HelperFile.xslt" />
Perform one of the following actions:
Applying templates in a specific mode, e.g.:
<xsl:apply-templates select="$currentPage/pageImage" mode="media" />
Calling a named template, e.g.:
<xsl:call-template name="PaginateSelection" />
Each helper has its own README but here’s a quick rundown:
A self-contained clip-on solution for pagination of node-sets.
"Just add Pagination"
Makes it very easy to work with various "picker" DataTypes in Umbraco, by having templates for each of the possible content nodes, and then using a key to grab all the picked nodes.
Simple Navigation generation - almost too easy. Supports the four most commonly needed navigations: Main navigation, Sub navigation, Breadcrumb and Sitemap.
Just like pagination - but for grouping sets into chunks of n elements.
Easy as pie generation of that monthly calendar view you always need for your events/news section. Yes to all of these:
Can I use my own translations for the weekdays?
Can I please have monday be the first day?
Can I show events on the dates?
A bunch of well-tested templates for handling Media items in Umbraco - if you've asked some of the following questions, this is definitely for you:
How can I output Media files and/or folders from my XSLT macros?
But I just want to render the image the user picked - why is it so hard???
How do I output a specific crop version?