Looping through pages and outputting the template html
Hi Guys,
I'm in the process creating a single page website that contains multiple pages rendered as one continuous page. I have a series of sub pages that I am intending to loop through and render the html content created by that page's template out.
My question is, is there a way to render out the content of the page's html? I can obviously do this in Javascipt but for this purpose I'd much rather have a server side implementation. I could of course add a couple of properties to my pages and then render the contents of those out, but I'd rather grab the page and actually render out the html that has been defined by its template which would allow me to define the page's style in the template.
Thank you so much for the additional info - I've updated my code accordingly. It's very easy to find outdated info for Umbraco but I'll definitely be studying the need library closely.
Looping through pages and outputting the template html
Hi Guys,
I'm in the process creating a single page website that contains multiple pages rendered as one continuous page. I have a series of sub pages that I am intending to loop through and render the html content created by that page's template out.
My question is, is there a way to render out the content of the page's html? I can obviously do this in Javascipt but for this purpose I'd much rather have a server side implementation. I could of course add a couple of properties to my pages and then render the contents of those out, but I'd rather grab the page and actually render out the html that has been defined by its template which would allow me to define the page's style in the template.
Hope this makes sense,
Thanks,
I've just found the answer,
@Html.Raw(umbraco.library.RenderTemplate(Page.Id));
is what you need. I thought I'd post this just in case anyone else wants to know.
Cheers,
Damien.
Hi Damien,
Yes, except that
umbraco.library.RenderTemplate(Page.Id)
has been superseded byUmbraco.RenderTemplate(Page.Id)
Jeavon
Jeavon,
Thank you so much for the additional info - I've updated my code accordingly. It's very easy to find outdated info for Umbraco but I'll definitely be studying the need library closely.
Thanks again,
Damien
No problem. You can find most of the UmbracoHelper methods documented here
is working on a reply...