Copied to clipboard

Flag this post as spam?

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


  • Eric K 6 posts 36 karma points
    Jun 20, 2014 @ 21:10
    Eric K
    0

    Accessing a razor template directly?

    Greetings. I am using Umbraco 6.1.5

    Background

    I have a razor template defined called "CustomerMasterWithNavigation.cshtml".

    Under the back office Content tab, various content pieces make use of this template.

    I have noticed that both of the following URLs return results:

    http://mysite.com/CustomerMasterWithNavigation (calling the template directly)

    and

    http://mysite.com/active-customers/acme-customer-summary (a content node)

    The first URL above returns an empty page (of course). Or even an error if the template expects property values that are not provided by actual content.

    The second URL works as expected and returns a full customer summary, populated as expected.

    My questions are:

    Can I prevent the direct link from working, so as not to confuse users?

    Thanks,

    Eric

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Jun 20, 2014 @ 21:20
    Jeavon Leopold
    100

    Hi Eric,

    This function is called "alt template" and you can find out how to disable it in this post.

    Jeavon

  • Eric K 6 posts 36 karma points
    Jun 20, 2014 @ 21:44
    Eric K
    0

    Great. Thanks for the quick cross reference to the actual name for the feature I found and the link. My issue is solved.

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Jun 20, 2014 @ 22:21
    Jeavon Leopold
    0

    Fantastic! You should have a green tick that you can click on the above answer to mark it as solved.

Please Sign in or register to post replies

Write your reply to:

Draft