Have you made any progress with the Components? I am trying to figure out how to list Content pages and use the component data in those listings, similar to how content templates work with asset listings.
My goal is to create a News Listing component that lists News content pages. Do you have any suggestions or recommendations on the best approach?
Hey, if you haven’t progressed with this, take a look at ‘cards-root’ in the sample component library, it provides an example of how it can be done. Basically still using asset listings, with JSON output, fetched by the component.
Thanks a lot, this is a big help towards listing assets via DXP Components. Could you please also let me know how to extract information from components on Content Pages, as the information is stored in the JSON schema at the Edge?
Listing Content Template data is possible as they use metadata. Have you been able to find a solution for extracting component data from Content Pages?
Hey mate, sorry for the very late reply. We’ve made quite a bit of progress with Components and Content Pages since I originally posted this.
If you’re still working on the News Listing, have a look at the cards-root example in the Squiz sample component library.
The pattern there is essentially:
Content Page assets → Matrix Asset Listing → JSON output → Component fetches the JSON → Component renders the cards
So you can still use the traditional Matrix Asset Listing approach for determining which assets are returned, then use the component for the presentation layer.
There’s an example of stripping the Matrix asset URI down to the asset ID and passing that as the root node to a Matrix-side JSON/proxy asset, which the component then fetches.
One thing I’d still be careful about is the distinction between listing Content Page asset data and reading data stored inside individual Page Builder components. I haven’t confirmed that arbitrary component configuration can be exposed directly through the listing, so for anything that needs to appear consistently in listings I’d still favour having that information available as structured/indexable page data.
For a straightforward News Listing though, the cards-root sample looks like the best place to start.