How To Manage Layouts As Pages
This content was moved to its own page from the Questions page.
NOTE: This content refers to the old-style XSL Layouts, which have long since been replaced. This content will not apply to most EditMe sites.
Q: [sbridewell, 2007-03-11] I'm getting adventurous with XSL layouts and have started splitting as much as possible of the XSL into separate pages in their own right, so that changes to the XSL are covered by EditMe's version control & change notification system, and the XSL layout itself (which doesn't have the same version control) contains only this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:include xhref="http://demo.editme.com/Xsl1Content" />
<xsl:include xhref="http://demo.editme.com/Xsl1HeaderFooter" />
<xsl:include xhref="http://demo.editme.com/Xsl1SystemMenu" />
<xsl:template match="root">
<xsl:variable name="content">
<xsl:call-template name="content"/>
</xsl:variable>
<xsl:call-template name="header-footer">
<xsl:with-param name="content" select="$content"/>
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>
Provided I've created the pages called Xsl1Content, Xsl1HeaderFooter and Xsl1SystemMenu, set their MIME type to text/xml, and populated them with the relevant templates as removed from the main XSL layout, everything works just fine. However, if I try to use a relative URL in the xsl:include (e.g. xhref="Xsl1Content" or xhref="/Xsl1Content") instead of the absolute URL, I get an error. How do I work out the correct URL to put into the xsl:include?
A: [matt] That's a great use of the layouts feature! The way that you're referencing the stylesheet using your site's URL is correct. EditMe page content cannot be referenced using a relative URL in an xsl:include tag.