Issue with Template Alias allowing any template to be used.
Hi everyone,
Just came across an oddity with version 7.1.9 that I was wondering if anyone could confirm or deny if it is intended behaviour? We have a content node that has certain templates that it is allowed to use and we can switch between those templates using the template alias functionality, so to switch from the default template to say PrintTemplate, you would change
www.myawesomesite.com
to
www.myawesomesite.com/PrintTemplate/
However, we've noticed that we can put any template alias after the page url and it will render it regardless of whether or not it's in the allowed template list. So if we used a non allowed template like so
www.myawesometemplate.com/NotAllowedTemplate/
then this will work and it will render the page using this template. So my question is, is this the correct behaviour for this functionality (as it doesn't feel like it) or do I need to be revving up my debugging tools?
Do you think this should be something that should be off by default? Just has the feel of something you should only enable if you know why you're doing it and what the reasons are behind allowing it.
It used to be very useful for loading AJAX data and other special use cases but I don't really ever use it any more. There is a great blog post about why we don't really need it any more here.
Ah ok, makes a bit more sense as to why that functionality is in there now. I've been using the WebApi for stuff like that so not come across that approach before, good to know the background behind it though so thanks for the info! ;-)
Issue with Template Alias allowing any template to be used.
Hi everyone,
Just came across an oddity with version 7.1.9 that I was wondering if anyone could confirm or deny if it is intended behaviour? We have a content node that has certain templates that it is allowed to use and we can switch between those templates using the template alias functionality, so to switch from the default template to say PrintTemplate, you would change
www.myawesomesite.com
to
www.myawesomesite.com/PrintTemplate/
However, we've noticed that we can put any template alias after the page url and it will render it regardless of whether or not it's in the allowed template list. So if we used a non allowed template like so
www.myawesometemplate.com/NotAllowedTemplate/
then this will work and it will render the page using this template. So my question is, is this the correct behaviour for this functionality (as it doesn't feel like it) or do I need to be revving up my debugging tools?
Thanks,
Simon
Hi Simon,
Yes, this is called alt template, please see this thread for more info.
Regards,
Jeavon
p.s. If you want to disable it you can, see here for info.
Fantastic, thanks Jeavon!
Do you think this should be something that should be off by default? Just has the feel of something you should only enable if you know why you're doing it and what the reasons are behind allowing it.
You're very welcome!
It used to be very useful for loading AJAX data and other special use cases but I don't really ever use it any more. There is a great blog post about why we don't really need it any more here.
Ah ok, makes a bit more sense as to why that functionality is in there now. I've been using the WebApi for stuff like that so not come across that approach before, good to know the background behind it though so thanks for the info! ;-)
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.