Copied to clipboard

Flag this post as spam?

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


  • Hardy Wang 91 posts 112 karma points
    Mar 23, 2012 @ 14:43
    Hardy Wang
    0

    How to get Error Page via API?

    I am using 4.7.1.1.

    When I set up public access I can choose "Error Page". How can I get it via API?

  • Hardy Wang 91 posts 112 karma points
    Mar 23, 2012 @ 14:52
    Hardy Wang
    0

    I noticed a function umbraco.cms.businesslogic.web.Access.GetErrorPage but it looks for "path" as parameter, there is no clear explanation what shall I pass to this one.

    Anybody has some clue?

  • Rodion Novoselov 694 posts 859 karma points
    Mar 23, 2012 @ 15:25
    Rodion Novoselov
    0

    Hi. The "Path" is a comma-separated list of node IDs starting from the root node down to the node in question (e.g. "-1,1076,1090"). You can get it by the @path attribute of the node in Xslt or the DynamicNode.Path property in Razor.

  • Hardy Wang 91 posts 112 karma points
    Mar 23, 2012 @ 18:27
    Hardy Wang
    0

    Thanks for the information.

    I used following statements to get error page associated with current node,

    // get current node
    DynamicNode currentNode = new DynamicNode(Node.GetCurrent());

    // find out the erro page node id of current node
    int erroPageNodeId = Access.GetErrorPage(currentNode.Path);

    // get Url of error page
    string erroPageUrl = library.NiceUrl(erroPageNodeId);

Please Sign in or register to post replies

Write your reply to:

Draft