Copied to clipboard

Flag this post as spam?

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


  • gilad 185 posts 425 karma points
    Apr 11, 2011 @ 16:11
    gilad
    0

    get father with some condition

    hii everyone.

    I'm pretty sure it's something simple but I can not get there.

    i want  to know how is the level 2  father of the current page.

    I do not know what is the level of the current page (  can be 3/4/5/ and on.. )

    thanks!.


  • Tom Fulton 2030 posts 4998 karma points c-trib
    Apr 11, 2011 @ 16:22
    Tom Fulton
    0

    Hi,

    Can you explain a bit further, not sure I completely understand what you are wanting.

    Are you wanting to know if the current page's level is greater than 2?  If so you could use:

    <xsl:if test="$currentPage/@level &gt; 2">

    Or are you wanting to get the current page's parent at level 2?

    <xsl:variable name="parentPage" select="$currentPage/ancestor-or-self::* [@isDoc][@level=2]"/>
    Parent:  <xsl:value-of select="$parentPage/@nodeName"/>

    Hope this helps,
    Tom

  • gilad 185 posts 425 karma points
    Apr 11, 2011 @ 16:28
    gilad
    0

    the second one.

    I had a little problem with the Xpath axes.

    thank you tom!

Please Sign in or register to post replies

Write your reply to:

Draft