Copied to clipboard

Flag this post as spam?

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


  • Lee 1130 posts 3088 karma points
    Sep 07, 2009 @ 13:08
    Lee
    0

    Newb API Question

    Hey all - Trying for the first time to create a couple of custom .NET controls for Umbraco, really quick question (And easy I suspect)

    I have a variable in my XSLT file

    $currentPage/data [@alias = 'headerText']

    How would I do this in .NET?

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Sep 07, 2009 @ 13:15
    Dirk De Grave
    0

    Hi Lee,

    umbraco.presentation.nodeFactory.Node.GetCurrent()

    will get you the current page (node) being processed.

    And use

    umbraco.presentation.nodeFactory.Node.GetCurrent().getProperty('headerText')

    to get the value for the property.

     

    Cheers,

    /Dirk

     

  • Thomas Höhler 1237 posts 1709 karma points MVP
    Sep 07, 2009 @ 13:17
    Thomas Höhler
    0

    Add a public property to the UserControl, compile the project, upload the ascx to /usercontrols and the dll to the /bin folder

    Go to the developer section, create a new macro, select the usercontrol, click the "BrowseProperties" button and see the magic of umbraco ;-)

    (or add the property ba hand to the properties tab of the macro)

    hth, Thomas

  • Thomas Höhler 1237 posts 1709 karma points MVP
    Sep 07, 2009 @ 13:18
    Thomas Höhler
    0

    Ahh, misunderstood your question, thank god we have Dirk...

    Thomas

  • Lee 1130 posts 3088 karma points
    Sep 07, 2009 @ 13:22
    Lee
    0

    Excellent thanks :)

Please Sign in or register to post replies

Write your reply to:

Draft