Specifying which Category to Post + Where
This is an open discussion with 1 reply, filed under XSLT.
Search
This is a pretty open-ended question but here is one way you could do it:
Assuming your XML structure looks like this:
<data> <articles> <entry> <title>My first article</title> <category> <item handle="announcement">Announcement</item> </category> </entry> <entry> <title>My other article</title> <category> <item handle="design">Design</item> </category> </entry> </articles> </data>
One way to achieve split columns based on categories would be:
<xsl:template match="data"> <div id="articles"> <div class="column-1"> <xsl:apply-templates select="articles/entry[category/item/@handle = 'announcement']"/> </div> <div class="column-2"> <xsl:apply-templates select="articles/entry[category/item/@handle = 'design']"/> </div> </div> </xsl:template> <xsl:template match="articles/entry"> <!-- Your article markup here --> </xsl:template>
There are more advanced and abstract ways to achieve the same thing, but first things first!
Create an account or sign in to comment.
I realize this is probably an extremely basic question. But, yeah… I'm also extremely new to both Symphony and XSLT, so please bear with me. Anyway, my problem is that I can't seem to figure out how to publish articles from specific categories in different locations on the same page.
Say, for instance, that I would like to split my page into two columns and then have one of them display articles from Category 1 while the other one is only picking up articles from Category 2 and so on… How exactly would this be done?
I've been scanning through the documentation, forums and what not for a while now without any luck… So if anything I'm starting to become very well aware of that I probably haven't fully understood the basic concept behind all this yet…