Displaying Subnode Content On The Parent Content Page
I've been having a lot of trouble figuring this out.
What I want is a FAQ page that displays all the questions and answers on the same page. It gets the content from the questions and answers from subnode content.
So for example my tree looks like this:
FAQList Question1
Question2
Question3
I want the template on FAQList to list the question and answer data from Question1...2... and 3 on the same page.
Every time I try to find examples of this being done I can only find examples that list the subpages as links. I don't want to link to the subpages. I want to actually print the content from them onto the parent page. Is that possible?
Displaying Subnode Content On The Parent Content Page
I've been having a lot of trouble figuring this out.
What I want is a FAQ page that displays all the questions and answers on the same page. It gets the content from the questions and answers from subnode content.
So for example my tree looks like this:
FAQList
Question1
Question2
Question3
I want the template on FAQList to list the question and answer data from Question1...2... and 3 on the same page.
Every time I try to find examples of this being done I can only find examples that list the subpages as links. I don't want to link to the subpages. I want to actually print the content from them onto the parent page. Is that possible?
This is my attempt at it:
<xsl:for-each select="$currentPage/node">
Question: <xsl:value-of select="data [@alias = 'question']"/><br/>
Answer: <xsl:value-of select="data [@alias = 'answer']"/><br/>
</xsl:for-each>
But I had no results. Help me out here. I'm banging my head on this.
Basically if I could just render each subnode's template on the parent node that would be wonderful!
Hi Bill
The code above relates to the old xml schema - are you running an older version of Umbraco ?
To get all sub nodes you could do
<xsl:for-each select="$currentPage/*">
This is a very shotgun approach as it will loop through all sub items.
Alternatively you could relpace the asterisx with the alias of the sub node type to ensure you only get FAQ's.
Hope this helps.
Nigel
Hi. A small erratum to what Nigel said:
(The difference is the "@isDoc" predicate)
Good point Rodion
Cheers
Nigel
is working on a reply...