Copied to clipboard

Flag this post as spam?

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


  • Streety 358 posts 567 karma points
    May 22, 2014 @ 14:39
    Streety
    0

    Calling CurrentPage.AncestorOrSelf from an extension class

    I am traversing the nodes to get the node I want within a partial:

                //Get settings from Ancestor Language Node
    var langPage = CurrentPage.AncestorOrSelf("lang");

    var emailTo = langPage.GetPropertyValue("emailAddressTo", "fallback").ToString();

    My question that I have an email helper class used to handle the smtp stuff.

    This also needs access to this node but obviously I don't have access to CurrentPage.

    Is there another way to search up the tree from current, find a node with doctype "lang" from an extension class?

    Any help gratefully received.

     

     

     

     

  • Jeavon Leopold 3008 posts 13221 karma points MVP 7x admin c-trib
    May 31, 2014 @ 07:56
    Jeavon Leopold
    0

    How do you use your extension class? Could you post the code?

    But I would probably pass CurrentPage as a variable to your email method....

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies