Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Ok, my Content looks like this:
Content
Places
City1
Employees
Management
Employee1
Employee2
Administration
Employee3
Employee4
Contact
Way to us
City2
...
What I want to do on each City-Page (City1, City2, ...), is to show each Employee grouped by their business area (Management, Administration, etc):
Management:
Administration:
How can I solve this via XSLT???
Thanks for your answers!
Hi Christoph,
This should get you going - assuming $currentPage is the "City" node, you can use the following XSLT in a macro to get started:
<?xml version="1.0" encoding="utf-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:umb="urn:umbraco.library" exclude-result-prefixes="umb" > <xsl:output method="xml" indent="yes" omit-xml-declaration="yes" /> <xsl:param name="currentPage" /> <xsl:template match="/"> <xsl:apply-templates select="$currentPage" /> </xsl:template> <!-- Template for $currentPage --> <xsl:template match="node[@nodeTypeAlias = 'City']"> <h1><xsl:value-of select="@nodeName" /></h1> <h2>Management</h2> <ul> <xsl:apply-templates select="node[@nodeName = 'Employees']/node[@nodeName = 'Management']/node" /> </ul> <h2>Administration</h2> <ul> <xsl:apply-templates select="node[@nodeName = 'Employees']/node[@nodeName = 'Administration']/node" /> </ul> </xsl:template> <!-- Template for a single employee --> <xsl:template match="node[@nodeTypeAlias = 'Employee']"> <li> <xsl:value-of select="@nodeName" /> </li> </xsl:template> </xsl:stylesheet>
(There's a couple of assumptions - e.g., that city nodes have an alias of "City" and that employee nodes have the alias "Employee", but you should be able to make the necessary changes yourself, if needed.)
/Chriztian
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Grouping pages with their children-pages
Ok, my Content looks like this:
Content
Places
City1
Employees
Management
Employee1
Employee2
Administration
Employee3
Employee4
Contact
Way to us
City2
Employees
...
What I want to do on each City-Page (City1, City2, ...), is to show each Employee grouped by their business area (Management, Administration, etc):
City1
Management:
Employee1
Employee2
Administration:
Employee3
Employee4
...
How can I solve this via XSLT???
Thanks for your answers!
Hi Christoph,
This should get you going - assuming $currentPage is the "City" node, you can use the following XSLT in a macro to get started:
(There's a couple of assumptions - e.g., that city nodes have an alias of "City" and that employee nodes have the alias "Employee", but you should be able to make the necessary changes yourself, if needed.)
/Chriztian
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.