Copied to clipboard

Flag this post as spam?

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


  • francois 7 posts 21 karma points
    Jan 09, 2009 @ 10:30
    francois
    0

    how to refernce a master page node from a detail page.

    Hi all.i am new to Umbraco and i first wanted to congratulate you for this software.

    i want to ask you a question but i want first to explain what is my case:

    [quote]1-i have a master page(aboutUsmaster) and a detail or content page(aboutuscontent).
    2-in the master page(aboutUsmaster) i have inserted an xslt macro which reads the flash name from document type properties of the master page and render then the flash object.
    3-(2) is working if i run the master page.
    4-but what happens is that if i run the content or the details page (aboutus
    content) the xslt is not working.
    [/quote]
    i tried to look up for the problem and i fount a reason:

    in my xslt macro i am using $currentPage as reference to the currently running or requested page so when i run the master page it works because in the mastre page i have the property in the doc type of this master page.

    but when i run the content page and this what is going to happen normally the xslt didn't find the the flash name property because what is running now is the content page (aboutuscontent) ,so the $currentpage variable is now (aboutuscontent) and not (aboutUs_master) so it is not going to find the property 'flash name " which is defined in document type of the master page.


    so an alternative solution to this is to add this property to the content page but this not professional at all .

    what i want is how ican refernce my master page (as a variable like $currentpage) when my content page is running.

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jan 09, 2009 @ 11:11
    Dirk De Grave
    0

    Hi,

    I think best is to check an excellent book on xslt axis found at http://umbraco.org/documentation/books/xslt-basics It shows the basics on how to traverse the tree structure in xslt.

    For example: $currentPage refers to the page currently requested.
    Parent node: $currentPage/parent or $currentPage/..
    Ancestors: $currentPage/ancestors::node
    Ancestors including current node: $currentPage/ancestors-or-self::node

    Construct you'd use depends on how the content tree is structured. If those content pages are 1 level below the master page, then getting the parent node should suffice.

    Or alternatively, if you don't want to use those xslt constructs, you could also set the parent node id as parameter



    and use that parameter to feed the umbraco.library:GetXmlDocumentById() function. Last xslt extension functions returns the node for the nodeId specified.

    Hope this helps.

    Regards,
    /Dirk

  • francois 7 posts 21 karma points
    Jan 09, 2009 @ 12:54
    francois
    1

    Thanks Dirk,

    it worked with this path:

Please Sign in or register to post replies

Write your reply to:

Draft