Adding a templateAlias after the url changes the rendered template
I was wondering why www.mywebsite.com/sitemap was rendering the sitemap without any node called sitemap being yet created in content. After some tries I discovered that simply adding a template alias after the url of the page renders the same page with the other template, withouth any check on the allowed templates.
This is expected behaviour, it is referred to as "alternative template", you can request any node be rendered against any template by requesting it by template alias. You do the same by appending ?altTemplate=sitemap to your Url. A node Url will of course take priority over a alt template request.
Adding a templateAlias after the url changes the rendered template
I was wondering why www.mywebsite.com/sitemap was rendering the sitemap without any node called sitemap being yet created in content. After some tries I discovered that simply adding a template alias after the url of the page renders the same page with the other template, withouth any check on the allowed templates.
Is this a bug or an expected behavior?
(tried it on umbraco 6 and umbraco 7)
Thanks
Hi Alessandro,
Welcome to Our!
This is expected behaviour, it is referred to as "alternative template", you can request any node be rendered against any template by requesting it by template alias. You do the same by appending ?altTemplate=sitemap to your Url. A node Url will of course take priority over a alt template request.
Jeavon
I was aware of the ?altTemplate but not of just the templateAlias added after the node name
Thank you very much!
Alessandro
is working on a reply...