Search

I'm not sure I ever mentioned this on the forum but maybe some of the following templates will be helpful for others around here:

Johanna and I curate a set of XSLT templates we regularly use for our projects on Github. So far, the kit contains:

  • datetime.xsl: This template is also bundled with the Date and Time extension that provides an additional Data Source for multilingual date formatting.
  • timeranges.xsl: This templates simplifies the creation of time ranges. There are two templates, timerange will print out a single time range based on a start and end date and timeranges which will create a list of multiple time ranges with custom separators (, / and).
  • names.xsl: This templates formats names (title, prefix, first name, surname, suffix), either as single name (using the name template) or as list of names (using the names template).
  • images.xsl: This is a helper template for JIT Image Manipulation. It offers optional resizing if resizing is needed. You can set the mode, width, height, position, background colour, you can automatically link the image to the original source or add classes, alt or title attributes.
  • twitter.xsl: This is a quite specialized template we use on our private blogs to include tweets. It links user names, hash tags, replaces shortened URLs by the long sources and optionally adds typographic quotes. I think the basic idea came from a template Nick Dunn once posted here on the forum.

Further more the kit bundles modified versions of Allen's well known ninja technique and Nick's pagination template:

  • ninja.xsl: This modified template adds three additional options: a level that is used to adjust the headline hierarchy (if you set it to 2, all h1 will become a h3, all h2 will become a h4 etc.). Also there are prefix and suffix parameters that are added to the first or the last matched element respectively.
  • pagination.xsl: This modified template uses HTML5 syntax (nav).

Thanks for sharing Nils,
Bookmarked this tread, it will definetly come in handy some day

We just added a new template for relative time distances:

Given a two dates, the template will return strings like "2 years, 7 months and 17 days" or "3 months". The template speaks English and German.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details