Copied to clipboard

Flag this post as spam?

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


  • Mr A 216 posts 278 karma points
    Mar 16, 2012 @ 11:44
    Mr A
    0

    How to find the current template id and name in the usercontrol

    Hi ,

    To look for current node we use ,

    Node currentNode = Node.GetCurrent();

    string myValue = currentNode.GetProperty("productDetails").Value;

    lblProductDetails.Text = myValue;

    but i have a got a scenario where i have to pass the property depending on the templates, i have got two templates which are using different document types, so if template1 get (Template1property1,......) similarly if Template2 get (Template2property1,......).

    Is it possible to acheive something like this or is there a better way of working out this in a single user control,

    Any assistance or help will be appreciated ,

    Thanks

     

  • Rodion Novoselov 694 posts 859 karma points
    Mar 16, 2012 @ 13:28
    Rodion Novoselov
    0

    Hi. "Node.GetCurrent().template" should return the template ID, I suppose.

  • Silvan Egger 28 posts 200 karma points
    Apr 20, 2016 @ 21:47
    Silvan Egger
    0

    OK and then you have the TemplateId but now how can you get the Template Node from the ID?

Please Sign in or register to post replies

Write your reply to:

Draft