Copied to clipboard

Flag this post as spam?

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


  • blackhawk 313 posts 1368 karma points
    Dec 07, 2017 @ 21:53
    blackhawk
    0

    Is it possible to get Template alias?

    With Umbraco 7.7.2+, is there way with either IPublishedContent or UmbracoHelper, or something similar in getting the given template alias?

    If it matters, I'm using models builder on my templates.

    Thanks

  • Matt Darby 28 posts 391 karma points c-trib
    Dec 08, 2017 @ 08:30
    Matt Darby
    104

    You can use .GetTemplateAlias() on IPublishedContent

    For example:

    var templateAlias = Model.Content.GetTemplateAlias();
    
  • blackhawk 313 posts 1368 karma points
    Dec 08, 2017 @ 15:34
    blackhawk
    0

    Many many thanks! That worked.

Please Sign in or register to post replies

Write your reply to:

Draft