Developer forum

Forum » Templates » RenderItemList and global paragraphs

RenderItemList and global paragraphs

René Poulsen
René Poulsen
Reply

Hi,

I'm creating a contactpage with departments and employees. Some of the employees belong to 2 or more departments, so I want to use global paragraphs for the employees.

The departments and employees are shown on a page using RenderItemList, but when trying to render all the employees for each department, the global paragaphs doesn't get rendered. I have a department (a page with ID = 34) with 3 employees. One of the employees is a global paragraph. When using this code, the global paragraph doesn't get rendered:


@RenderItemList(new {
ItemType = "Employee",
ListSourceType = "Page",
ListOrderBy = "Sort",
IncludeAllChildItems = "true",
IncludeParagraphItems = "true",
ListSourcePage = 34,
ItemFieldsList = "*",
ListTemplate = "itempublisher/list/contact.employeelist.cshtml",
ListPageSize = 1000
})

Is there anyway to get the global paragraphs rendered this way?


Replies

 
Nicolai Pedersen
Reply

Nope, I am affraid not...

The global paragraph is a content rendering feature and does not work outside regular paragraphs.

Sorry about the inconvenience.

BR Nicolai

 
Nicolai Pedersen
Reply

And generally you should avoid paragraph items for anything but regular paragraphs. Usually it would make more sense to use page based items for stuff like this.

 

You must be logged in to post in the forum