Quantcast
Channel: C1 CMS Foundation - Open Source on .NET
Viewing all articles
Browse latest Browse all 2540

New Post: How do you loop through child pages of a parent page and display meta field values?

$
0
0
Hi,

I solved a similar problem with Marcus' example here. But I have another advanced question:

I have the following site structure:
  • Home
  • Big Houses
  • Destinations
    • Sweden
      • House A
      • House B
      • House C
    • Denmark
      • House A
      • House B
      • House C
    • Italy
      • House A
      • House B
      • House C
On the page 'Destinations' I have the following xslt-function to display the countries (Sweden, Denmark, Italy, ...) with their MetaData (Image, Description, ...):
<xsl:for-each select="/in:inputs/in:result[@name='SitemapXml']/Page">
                <xsl:variable name="laenderinfos" select="/in:inputs/in:result[@name='GetLaenderinfosXml']/Laenderinfos[@PageId=current()/@Id]" />
                
                
                        <!-- 1/3 Column -->
                        <div class="one-third column portfolio-item scenery">
                            <div class="picture"><a href="~/Page({$laenderinfos/@PageId})"><img src="~/media({($laenderinfos/@Bild.KeyPath)})?mw=500" alt=""/><div class="image-overlay-link"></div></a></div>
                            <div class="item-description alt">
                                <h3><a href="~/Page({$laenderinfos/@PageId})"><xsl:value-of select="$laenderinfos/@PageId.MenuTitle" /></a></h3>
                                <!--<p><xsl:value-of select="$laenderinfos/@Beschreibung" /></p>-->
                                
                            </div>
                        </div>
                                            
                    </xsl:for-each>
On the country pages (Sweden, Denmark, Italy,...) I have the following xslt-function to display the houses (House A, House B, House C,...) with their MetaData (Image, Description, ...):
<xsl:for-each select="/in:inputs/in:result[@name='SitemapXml']/Page">
                <xsl:variable name="reiseinfos" select="/in:inputs/in:result[@name='GetReiseinfosXml']/Reiseinfos[@PageId=current()/@Id]" />
                
                        <!-- 1/4 Column -->
                        <div class="four columns portfolio-item">
                            <div class="picture"><a href="~/Page({$reiseinfos/@PageId})"><img src="~/media({($reiseinfos/@Bild.KeyPath)})?w=220&amp;h=165" alt=""/><div class="image-overlay-link"></div></a></div>
                            <div class="item-description alt">
                                <h5><a href="~/Page({$reiseinfos/@PageId})"><xsl:value-of select="$reiseinfos/@PageId.MenuTitle" /></a></h5>
                                <p><xsl:value-of select="$reiseinfos/@Beschreibung" /></p>
                                
                            </div>
                        </div>
                                            
                    </xsl:for-each>
Now I want to show a subset from all houses of all countries with a special 'House Type' defined in their MetaData (e.g. "Big Houses") on a separate page 'Big Houses' - but ordered like in the tree (Show me all "Big Houses" on one page)
  • House A from Sweden
  • House C from Sweden
  • House B from Denmark
  • House C from Denmark
  • House C from Italy
I don't know how to create the function to get these houses displayed on the page 'Big Houses'.

Maybe someone can give me some help, an idea or an example.

Thanks,

Thorsten

Viewing all articles
Browse latest Browse all 2540

Trending Articles