Copied to clipboard

Flag this post as spam?

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


  • Edward Dudley 80 posts 121 karma points
    Nov 11, 2009 @ 16:49
    Edward Dudley
    0

    Get Template ID

    This seems really simple but I can't work out how to do it - maybe I'm missing something...

    Is it possible to get the node ID of a template from its alias or name?

    I've tried GetItem and GetXmlNodeById from the Umbraco library.

  • Kim Andersen 1447 posts 2196 karma points MVP
    Nov 11, 2009 @ 21:47
    Kim Andersen
    0

    Do you wan't the template id on the node that you currently stand on, or what do you mean?

     

     

  • Casey Neehouse 1339 posts 483 karma points MVP 2x admin
    Nov 12, 2009 @ 05:37
    Casey Neehouse
    2

    As far as I am aware, there is not a library method.

    You can however use

    umbraco.cms.businesslogic.template.Template.GetByAlias('alias').Id

    You will need to make an extension for this if you want to use it in XSLT

  • Edward Dudley 80 posts 121 karma points
    Nov 12, 2009 @ 11:15
    Edward Dudley
    0

    @Kim I wanted to get the node ID of any template given its alias

    @Casey Thanks!  Thanks exactly what I was after!

Please Sign in or register to post replies

Write your reply to:

Draft