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
    Mar 29, 2013 @ 12:47
    Martin
    0

    Display Child Node Template in Parent

    Hi, 

    Im looking for help in showing the content of child nodes within the parent node.

    These child nodes have different document types and templates.

    I can pull the child node info in, if it is the same template & fields.

    Any ideas would be grateful?

     

     

    <xsl:param name="currentPage"/>

    <xsl:template match="/">
    <xsl:variable name="content" select="$currentPage/descendant-or-self::Product-ProductItem/*[@isDoc]"/>

    <xsl:for-each select="$content">
    <div class="row">
    <xsl:attribute name="id">
    <xsl:value-of select="umbraco.library:Replace(@nodeName,' ', '')" />
    </xsl:attribute>
    <h4>
    <xsl:value-of select="@nodeName" />
    </h4>
    <p class="lead"><xsl:value-of select="leadParagraph" disable-output-escaping="yes"/></p>
    <xsl:value-of select="bodyText" disable-output-escaping="yes"/>
    </div>
    </xsl:for-each> 
    </xsl:template>

  • Fuji Kusaka 2203 posts 4220 karma points
    Mar 29, 2013 @ 13:07
    Fuji Kusaka
    0

    Hi Martin,

    So basically you just want to display the content of child page within the parent node ?

    Just like you would do to make a test for any child node or doc ./* [@isDoc]

    <xsl:variable name="test" select="./propertyAlias"/>  
                  <xsl:if test="normalize-space($test)">
                       <xsl:value-of select="propertyAlias" disable-output-escaping="yes"/> 
                </xsl:if>
  • Martin 278 posts 662 karma points
    Mar 29, 2013 @ 13:20
    Martin
    0

    Hi Fuji, 

    Im looking to display the child template within the parent.

    I have a tree something like this.

    - Product
    -- Product Feature Type A
    -- Product Feature Type B
    -- Product Feature Type C 

    Each "Product Feature" has different property fileds and template.

    Rather than have one xslt file atht list all these fields, I was looking for a way to get the child node info as a template.

    Ideally this would allow the sorting of each of the "Product Features" within the parent node, in keeping with the order of the child nodes.

    Thanks 

     

  • Martin 278 posts 662 karma points
    Apr 08, 2013 @ 12:05
    Martin
    0

    Anyone, Im still stumped on this.

  • dan 29 posts 53 karma points
    Apr 10, 2013 @ 22:41
    dan
    0

    Did you try to utilize the built in render template for xslt? <xsl:value-of select="umbraco.library:RenderTemplate('Int32 PageId')"/>  

    Otherwise are you trying properties from the child by themselves or using the template they are in on those page?

  • Martin 278 posts 662 karma points
    Apr 11, 2013 @ 15:02
    Martin
    0

    Hi Dan, 

    Ive tried using 

    <xsl:value-of select="umbraco.library:RenderTemplate(@id,@template)" disable-output-escaping="yes"/>

    But it pulls the whole outputted child page, into parent template.

    Is there any way to output just what is inside the ASP Content Placeholder?

     

  • Rich Green 2246 posts 4008 karma points
    Apr 11, 2013 @ 15:21
    Rich Green
    0

    You want uComponents Render Template :)

    http://ucomponents.codeplex.com/wikipage?title=RenderTemplates

Please Sign in or register to post replies

Write your reply to:

Draft