I have a folder within Umbraco (6) that has some child pages. Each child page has an image and their name
**Parent (Parent Folder)
Child1 (Child page)
Child2 (Child page)
Child3 (Child page)
Child4 (Child page)**
I have some javascript on the template used by the parent page. What i would like to do is to loop through the child pages, so i can return each of their names and image.
How could i loop through the pages and get the relevant info?
How are you rendering data on your site currently? Are you using XSLT? Or user controls? Or umbraco:item tags? Just asking to figure out how to help you since a Razor response does not make sense if you're using XSLT and the other way around if you're using Razor then the XSLT example won't make any sense :)
It's been a while since I had a look at v6 (and web forms in general) so can't quite remember whether Sørens example would work directly or if you should use macroscripts...
You can write it in CDATA section but I'm not sure what it is you want to achieve and why you want to mix JavasSript and XSLT? Or JavaScript and Razor for that sake?
Any particular reason why that JavaScript can't be run from it's own seperate file hooking into an id or a class?
Loop through pages
I have a folder within Umbraco (6) that has some child pages. Each child page has an image and their name
**Parent (Parent Folder)
Child1 (Child page)
Child2 (Child page)
Child3 (Child page)
Child4 (Child page)**
I have some javascript on the template used by the parent page. What i would like to do is to loop through the child pages, so i can return each of their names and image.
How could i loop through the pages and get the relevant info?
Would this work even though im not using MVC?
Hi J
How are you rendering data on your site currently? Are you using XSLT? Or user controls? Or umbraco:item tags? Just asking to figure out how to help you since a Razor response does not make sense if you're using XSLT and the other way around if you're using Razor then the XSLT example won't make any sense :)
It's been a while since I had a look at v6 (and web forms in general) so can't quite remember whether Sørens example would work directly or if you should use macroscripts...
/Jan
Hi, i ditched this idea as i figured out XSLT doesnt allow javascript so i am now trying with a chtml. Thanks
Hi J
You can write it in CDATA section but I'm not sure what it is you want to achieve and why you want to mix JavasSript and XSLT? Or JavaScript and Razor for that sake?
Any particular reason why that JavaScript can't be run from it's own seperate file hooking into an id or a class?
/Jan
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.