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 568 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 3074 posts 13631 karma points MVP 11x 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....

Please Sign in or register to post replies

Write your reply to:

Draft