Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Simon Napper 113 posts 347 karma points
    Jan 12, 2015 @ 16:10
    Simon Napper
    0

    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

  • Jeavon Leopold 3074 posts 13631 karma points MVP 11x admin c-trib
    Jan 12, 2015 @ 16:14
    Jeavon Leopold
    100

    Hi Simon,

    Yes, this is called alt template, please see this thread for more info.

    Regards,

    Jeavon

  • Jeavon Leopold 3074 posts 13631 karma points MVP 11x admin c-trib
    Jan 12, 2015 @ 16:15
    Jeavon Leopold
    0

    p.s. If you want to disable it you can, see here for info.

  • Simon Napper 113 posts 347 karma points
    Jan 12, 2015 @ 16:32
    Simon Napper
    0

    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.

  • Jeavon Leopold 3074 posts 13631 karma points MVP 11x admin c-trib
    Jan 12, 2015 @ 16:35
    Jeavon Leopold
    1

    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.

  • Simon Napper 113 posts 347 karma points
    Jan 12, 2015 @ 16:44
    Simon Napper
    0

    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! ;-)

Please Sign in or register to post replies

Write your reply to:

Draft