Copied to clipboard

Flag this post as spam?

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


  • Rik Hodiamont 56 posts 156 karma points
    May 04, 2011 @ 16:36
    Rik Hodiamont
    0

    Display value of another document type

    Hi,

    I have a question. I'm using the following site structure.

    -site 1

    -- button 1

    -- button 2

    - site 2

    -- button 1

    -- button 2

    The 'site' document type has three values witch must be displayed on the pages button 1 and 2. So I add the values in the master template. I only see the values when I'am on  page site 1 and site 2. But when I'm on the page of button 1 the value is empty. That's not so strange because the value is not in the document type of 'button'. Can I refer to a value of the document type 'site'?

    Thanks for your help.

     

  • Rich Green 2246 posts 4008 karma points
    May 04, 2011 @ 17:17
    Rich Green
    0

    Hey,

    Not tested but this should work

    $currentPage/parent::node/nameOfTheProperty" />

    Rich

    Edit: that will only work on the node when you are in the 'button' nodes, do you have the same template for both?

  • Rik Hodiamont 56 posts 156 karma points
    May 04, 2011 @ 17:29
    Rik Hodiamont
    0

    Rich thanx for your reply, but unfortunately It won't work on page 'button'. I use the same template for both 'sites'.

  • Rich Green 2246 posts 4008 karma points
    May 04, 2011 @ 17:42
    Rich Green
    0

     <xsl:value-of select="$currentPage/ancestor-or-self::*[@level=1]/descendant::NameOfYourDocType[@isDoc]/nameOfPropertyHere"/

  • Rik Hodiamont 56 posts 156 karma points
    May 04, 2011 @ 17:47
    Rik Hodiamont
    0

    That won't work either.

    I have the following to things in the macro:

      <xsl:value-of select="$currentPage/parent::node/bedrijfsnaam"/>
      
      <xsl:value-of select="$currentPage/ancestor-or-self::*[@level=1]/descendant::Home[@isDoc]/bedrijfsnaam"/>

    When I'm on 'site' it displays the value, when i'm on the page, it won't display anything.

  • Rich Green 2246 posts 4008 karma points
    May 04, 2011 @ 17:49
    Rich Green
    0

    Hey Rik,

    What's the DocTypeAlias of your 'site' nodes where the property 'bedrijfsnaam' is on?

    Rich

  • Rik Hodiamont 56 posts 156 karma points
    May 04, 2011 @ 17:53
    Rik Hodiamont
    0

    Hey Rich,

    I checked the Alias called 'Home'.

    Rik

  • Rich Green 2246 posts 4008 karma points
    May 04, 2011 @ 18:02
    Rich Green
    0

    Hey Rik,

    This should sort it

    <xsl:value-of select="$currentPage/ancestor-or-self::* [@isDoc]/descendant-or-self::Home[@isDoc]/bedrijfsnaam" />

    Rich

  • Rik Hodiamont 56 posts 156 karma points
    May 04, 2011 @ 18:08
    Rik Hodiamont
    0

    That works :) Thanx you very much!

Please Sign in or register to post replies

Write your reply to:

Draft