Hi im trying to wrap subpages from an id in pairs of 2, but im kinda stuck. So any pointer would be very nice. Right now i have the following code, which i read up on somewhere, but i think either my scpoping or matching is off.
OK - that explains it - you need to use *[@isDoc] instead of node (or better: If they're all the same Document Type - use the alias, e.g.: Testimonial)
<xsl:templatematch="/"> <divid="testimonials"> <xsl:apply-templatesselect="umbraco.library:GetXmlNodeById($source)/*[@isDoc][position() mod $n = 1]"/> </div> </xsl:template>
Grouping nodes in list
Hi im trying to wrap subpages from an id in pairs of 2, but im kinda stuck.
So any pointer would be very nice.
Right now i have the following code, which i read up on somewhere, but i think either my scpoping or matching is off.
Hi. It can be done e.g. the following way:
Hi Claus,
In your node template you're selecting <item> siblings - probably a typo, right? Try this instead:
/Chriztian
Hmmm Chriztian.
It still doesnt work.It renders the main div "Testemonials" but doesnt render "client-testemonials" at all.
Hi Claus - works on my machine :-)
Ok, you're using the old schema, right? (Hence the "node" element)
/Chriztian
no, im on 4.7.1
OK - that explains it - you need to use *[@isDoc] instead of node (or better: If they're all the same Document Type - use the alias, e.g.: Testimonial)
/Chriztian
EDIT: Updated to use GetXmlNodeById()
im going crazy!
Ive copy/pasted your code, but it still doesnt render the inner div... Ive been staring at it for ages, but cant seem to find any errors!
Doing a normal
Works fine, so the nodes are published and accessible...
It seems there's a misspelling - "node" means any node with the name "node".
To select all nodes you need to spell it as "node()".
Hi Claus,
My bad!! Really - I forgot to use GetXmlNodeById() - (on my local machine I use something else that doesn't work in Umbraco context).
I've updated the code above - please try again.
@Rodion: "node" in this context is actually from the old XML Schema in Umbraco; Bit confusing, yes, if you're used to XSLT :-)
SUCCESS!!!! i thought
//*
was som kind of fancy shorthand :)
It's a very bad shorthand - but works fine when you've only got a small set of nodes for testing :-)
/Chriztian
Thanks Chriztian and Claus
Updatd XSLT worked at it is with modifcation //*
is working on a reply...