Developer forum

Forum » Templates » Paragraph loop inside XSLT navigation

Paragraph loop inside XSLT navigation

Adrian Ursu
Reply

Hi,

I need to display a list of pages, and in that list I need to display the image associated with the first paragraph of each of the pages. Like a child list that displays images and titles.

I tried to do it using xslt navigation but it seems I can only list the attributes of the pages. Is there any way I can list the content of the first paragraph of each page? Like a paragraph loop with a position condition? Something a bit more granular than Global:Paragraph.Content([ID])

I don't want to use the navigation image since it is very hard for the admins to access that field (yeah, they are kind of stupid)

I would be able to do it if there would be access to an xml with the content of the pages similar with NavigationTree.

Any ideeas? 

Thanks

 


Replies

 
Nuno Aguiar
Reply

Hi Adrian,

 

What about using Data Management to get the paragraphs info? That would do the trick. You would need to create your own SQL query for that matter.

 

Nuno

 
Adrian Ursu
Reply

Hi Nuno,

Have not used Data management before. Can you please elaborate?

Although, it might be a problem if the template is used on several sections. But it worth a shot.

 
Nicolai Høeg Pedersen
Reply

Hi Adrian

 

In modules, use the datalist module, create a new view using a custom SQL. See manual here:

http://manual.dynamicweb-cms.com/Dynamicweb-On-line-Manual/Modules/Data-Lists/Lists.aspx

 

The SQL you need would be something like this:

 

SELECT        dbo.Page.PageID, dbo.Page.PageMenuText, dbo.Page.PageAreaID, dbo.Paragraph.ParagraphID, dbo.Paragraph.ParagraphHeader, 
                         dbo.Paragraph.ParagraphText, dbo.Paragraph.ParagraphImage
FROM            dbo.Page INNER JOIN
                         dbo.Paragraph ON dbo.Page.PageID = dbo.Paragraph.ParagraphPageID
WHERE        (dbo.Paragraph.ParagraphSort = 1)

This will give you a list of pages and the first paragraph on each page.

 

Then use the datalist module on a paragraph to publish the list of pages/paragraphs. Alter the template to do what you need.

 
Adrian Ursu
Reply

Thanks Nicolai,

I'll give it a shot

 

You must be logged in to post in the forum