Copied to clipboard

Flag this post as spam?

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


  • steschu 88 posts 489 karma points
    Apr 15, 2019 @ 13:39
    steschu
    0

    TemplateName append in URL

    Hi,

    I noticed that I can append a template's name to a valid Url and it is beeing displayed. Let's say I have a Url like www.mysite.com/node1/subnode1/mypage then I can call an url like www.mysite.com/node1/subnode1/maypage/newspage when I have a template called newspage.cshtml.

    Could anybody explain that behaviour to me?

    Thanx, Stephan

  • Amir Khan 1289 posts 2746 karma points
    Apr 15, 2019 @ 20:33
    Amir Khan
    100

    Its actually an alternative template so you could render a page with a different template than the one assigned in the back-office. A common use case for us is to render blog categories where you don't really need a categories page but you can filter a blog by using a different template at something like blogaddress.com/categories?categoryID=1234

    Here's a video on it, hitting the template by name has the same effect as putting the altTemplate querystring like this: blogaddress.com?altTemplate=categories

    Video: https://umbraco.tv/videos/umbraco-v7/implementor/fundamentals/templating/alt-template/documentation

  • steschu 88 posts 489 karma points
    Apr 16, 2019 @ 12:33
    steschu
    0

    Thanks for the explanation. Cheers Stephan

  • 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.

Please Sign in or register to post replies