Copied to clipboard

Flag this post as spam?

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


  • Molly 94 posts 134 karma points
    Oct 04, 2012 @ 22:46
    Molly
    0

    Display Content of each child node seperately on parent page

    Hi All, 

    I am trying to display the content of each child node of the parent on the parent page. I have a page named:

    Work (parent node) 

    Creative (child)

    Business (child) 

    Market (child)

    within each child i have project items for each node, now i can get all the project items to show on the parent page, but i want it to display each child node content on seperate lines e.g.

    Creative 

    {projectItem} {projectItem} {projectItem}

    Business

    {projectItem} {projectItem} {projectItem}

    Market

    {projectItem} {projectItem} {projectItem}

    Styled in Div's, i know it is probably something simple. 

    In my XSLT file i have 

    $currentPage/ProjectGroupPage/ProjectItem

    and this displays them all from all nodes,

    my aim is to have 

    $currentPage/Creative/ProjectItem and so on for each. 

    this is what i have so far.

    [CODE]

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [
      <!ENTITY nbsp "&#x00A0;">
    ]>
    <xsl:stylesheet
      version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:msxml="urn:schemas-microsoft-com:xslt"
      xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:autofolders.library="urn:autofolders.library" xmlns:uTube.XSLT="urn:uTube.XSLT"
      exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets autofolders.library uTube.XSLT ">


      <xsl:output method="xml" omit-xml-declaration="yes"/>

        <xsl:param name="currentPage"/>


    <xsl:template match="/">
      <xsl:for-each select="$currentPage/Creative/ProjectItem">
      <div class="item">

                  <href="{umbraco.library:NiceUrl(@id)}">
                  <img id="project-home-image">
                    <xsl:attribute name="src">
                      <xsl:text>/imageGen.ashx?image=</xsl:text>
                      <xsl:value-of select="RF-Slide/image"/>
                      <xsl:text>&amp;width=172&amp;height=166</xsl:text>
                    </xsl:attribute>
                    <xsl:attribute name="alt">
                      <xsl:value-of select="title"/>
                    </xsl:attribute>
                  </img>
                 </a>
             <href="{umbraco.library:NiceUrl(@id)}">
                 <h2>
                    <!--<xsl:attribute name="title">
                      <xsl:value-of select="projectTitle"/>
                    </xsl:attribute>-->
                    <xsl:value-of select="@nodeName"/>
                </h2>
                 </a>
                
             <!--<p><xsl:value-of select="projectSummary"/></p>-->
        

              </div>


       <!-- Question: <xsl:value-of select="./question"/><br/>
        Answer: <xsl:value-of select="./answer"/><br/>-->
    </xsl:for-each>

     </xsl:template>
    </xsl:stylesheet>

    [/CODE]

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies