I have been looking into Symphony quite a bit, and although I am a very slow learner, I have created a few basic websites. One thing I am struggling with is, I want my main page template (home.xsl) to show one template if there is a url parameter, and if the parameter is empty then just show another template.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
omit-xml-declaration="yes"
encoding="UTF-8"
indent="yes" />
<xsl:template match="/">
<html>
<head>
<title>Homepage</title>
</head>
<body>
<h2>Videos</h2>
<ul>
<xsl:apply-templates select="/data/videos/entry"/>
</ul>
</body>
</html>
</xsl:template>
<xsl:template match="videos/entry/single">
<div class="video"><xsl:value-of select="greeting-text"/></div>
</xsl:template>
<xsl:template match="videos/entry">
<li><xsl:value-of select="greeting-text"/></li>
</xsl:template>
</xsl:stylesheet>
For example, in the above code (adapted from the 'Hello World!' Symphony tutorial), there is a template match="videos/entry/single"
and template match="videos/entry"
. I would like the first template to show up if there is a URL parameter defined (e.g. I am loading up website.com/parameter), and it would show the 'parameter' video, and if there is no parameter defined it will show all videos, i.e. the second template.
I have a real problem explaining things, especially when I don't fully know the technology, so excuse any idiocies in my writing, and I would be happy to explain more if necessary.