kcl-ddh / kiln

Kiln is a multi-platform framework for building and deploying complex websites whose source content is primarily in XML. It brings together various independent software components into an integrated whole that provides the infrastructure and base functionality for such sites.
Apache License 2.0
34 stars 62 forks source link

How to copy or integrate CSS in the Kiln inscription pages? #15

Closed IoannaKy closed 9 years ago

IoannaKy commented 9 years ago

I was wondering how to include the ../xsl/global.css in the sample inscription pages. Is this achievable by adding the CSS as a new link to the base.xsl file, using an xsl:if for including it only for /sample/ and /corpus/ pages, or is there another way to include contextual css in Kiln?

Thank you in advance.

ajenhl commented 9 years ago

Add the reference to the CSS to a suitable template file in assets/templates. Rather than put logic (determining when to include it and when not), just make or edit a template for the class of pages for which you want that CSS to be present, and associate that template with the pipeline that matches the URLs for those pages.

If you absolutely have to have some logic in there, a Kiln template can make use of xsl:if etc; templates are converted into XSLT by the template processor. The main restriction is that the whole template is converted into a single xsl:template, but that is hardly likely to be relevant in this case.

I hope that helps!