Developer forum

Forum » Feature requests » Item Publisher - Global Paragraph Items

Item Publisher - Global Paragraph Items

Nuno Aguiar
Reply

Hi,

 

When using the Item Publisher, if we want to load all of the items from a specific page, the Item Publisher does not take into account Items that are global elements.

 

Ex:

 - We have a repository of locations (paragraph items)

 - We also have a set of pages (items) that act as groups, where locations can belong to several groups

 - Later we want to list locations from a specific group (page) - The item publisher returns empty

 

The Item Publisher should consider global elements, since we want them to be displayed as part of that page.

 

Best Regards,

Nuno


Replies

 
Nicolai Høeg Pedersen
Reply

No it should not. An item is located ONE place. If you want to publish items from 2 places, include those 2 places.

 
Nuno Aguiar
Reply

Hi Nicolai,

 

I did not make myself understand. I do not want to publish items from two places (pages). I want to publish items from 1 single place.
However, I created multiple pages (items) that work as categories, and want to create unique items, that may exist in multiple pages.

 

Using another example:

- Simulating Products and Categories

- I create a tree structure of categories (items as pages)

- I assign a product (items as paragraph) to multiple categories (pages) as global elements

- Using the item publisher to show products of a specific category will not give me all of them because some will be global elements. If I navigate to that category (open the page) it works fine - but sometimes that is not an option. We want/need to use the Item Publisher

 

Best Regards,

Nuno

 
Mikkel Ricky
Reply
This post has been marked as an answer

It does not make sense to use global elements like that. Items do not know anything about global elements and nor does the item publisher.

I understand what you're trying to do and I'm trying to think of a way to do it using items. The first thing to do is to make sure that a Product has references to Categories, i.e. a Product item must have explicit references to its catogories to make it work. In Dynamicweb 8.5 you can use an item field of type Item relation list for this.

Item relation list lets you add references to existing items of a specific type and this gives you a link from a Product to a number of Categories. When rendering a Product in the frontend you get a loop with referenced Categories. The relation between a Product and a Category can also be used to find Products in a specific Category, and we're currently working out how to make this reverse relation available in templates and in the item publisher.

Best regards,
Mikkel

Votes for this answer: 1
 
Nuno Aguiar
Reply

Hi Mikkel,

 

I see your point. I did not get my head around the item relation list yet, but will make some tests.

 

I will make some tests and see how to get this working like we need them to.

 

Best Regards,

Nuno