Copied to clipboard

Flag this post as spam?

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


  • Martin 278 posts 662 karma points
    Jul 26, 2011 @ 12:39
    Martin
    0

    Embedded Content - Recursive

    Hi there, 

    Ive used the embedded content package to create an address section within the footer of the page.I have then applie the macro within the master page. 

    My issue is that the content within the macro is not showing up within the child pages.

    I can set the macro to recursive, but it doesnt popular the child pages.

    My xslt for the macro is 

    Any help would be grateful

    Martin

    <xsl:param name="currentPage"/>
    <xsl:template match="/">
    <!-- start writing XSLT -->
       
        
    <xsl:for-each select="$currentPage/footerAddress/data/item">
      <ul class="footAddress">
        <li><xsl:value-of select="line1"/></li>
        <li><xsl:value-of select="line2"/></li>
        <li><xsl:value-of select="city"/></li>
        <li><xsl:value-of select="state"/></li>
        <li><xsl:value-of select="country"/></li>
        <li><xsl:value-of select="area"/></li>
        <li>T: <xsl:value-of select="telNo"/></li>
        <li>E:       
          <a>
            <xsl:attribute name="href">mailto:<xsl:value-of select="email"/></xsl:attribute>
            <xsl:value-of select="email"/>
          </a>
        </li>  
        <li>W: 
          <href="http://{web}" target="_blank">
            <xsl:value-of select="web"/>
          </a>
        </li>
      </ul>
         
    </xsl:for-each>
      
    </xsl:template>
  • Martin 278 posts 662 karma points
    Jul 26, 2011 @ 12:48
    Martin
    0

    Sorry guys,

    Did some digging in the forums and got the correct $currentPage path for recursive values.

    This did the trick.

     

    <xsl:for-each select="$currentPage/ancestor-or-self::*[@level = 1]/footerAddress/data/item">

     

  • aghy 129 posts 308 karma points
    Jul 26, 2011 @ 12:52
    aghy
    0

    Hi Martin,

    I think you need to change $currentPage to 

    $currentPage/ansestor-or-self/footerAddress ...

    Check out this page on XPath Axis, might help you out in the future.

    Hope this helps.

    Ben

  • aghy 129 posts 308 karma points
    Jul 26, 2011 @ 12:55
    aghy
    0

    Oops, a little slow there. 

    Looks like you already got it, you don't need to specify the level or have ::* bit.

    Ben

  • Martin 278 posts 662 karma points
    Jul 27, 2011 @ 09:59
    Martin
    0

    Cheers Ben, 

    That XPath Axis page will definitely come in helpful.

    Thanks.

Please Sign in or register to post replies

Write your reply to:

Draft