Developer forum

Forum » Development » loping through paragraphs

loping through paragraphs


Reply

I have creates a page with a couple of subpages.

These subpages have a paragraph whith some text.

I whant to get the text from these subpages and show them on the parent page.

 

I have tryed using xslt but I can't find the paragraph information.

I can only get the information from the page and not the paragraphs in the page.

 

I need the content(the text in the editor) from the paragraphs.

How can I get this information?


Replies

 
Jakob Westhausen
Reply
 Did somebody find a solution?
 
Nuno Aguiar
Reply
Hi,

The way I see it you have 2 solutions:
  1. Through Dynamicweb, assing the paragraphs as global elements to the parent page OR
  2. custom develop a solution that gathers all page ids in a array where parentPageID = current PageID and the get all the paragraphs where pageID = array of pageID's from the first query
Nuno
 
Jakob Westhausen
Reply
Thanks Nuno, but I would prefer using XSLT for managing all the content, so the end-user only have to create a subpage.
I manage to render the content of a subpage paragraph, but I can't figure out how to render all of the subpages.

This is what I got so far:
<xsl:template name="globalparagraph">
<xsl:param name="paragraphid" />
<xsl:comment>
<xsl:value-of select="concat('@Global:Paragraph.Content(',714766',')')" />
</xsl:comment>
</xsl:template>

and so show the content.
<xsl:call-template name="globalparagraph">
<xsl:with-param name="paragraphid" />
</xsl:call-template>
 
Nuno Aguiar
Reply
Hi Jacob,

Well, unless there's some new fancy way of doing things, my guess would be ajax calls to get subpages content. Without custom development I don't see it any other way.

It's not a bad approach even, considering the "mobile first" approach:
 - call the subpages forcing a "clean" page template for fast response
 - the bad thing is that you had to do it one page at a time :(

Hope it helps,
Nuno

 

You must be logged in to post in the forum