2

We have a page to load & show all published News component dynamically. The component number is pretty big, more than 100. When we start query, it can support pagination. But it can only return the component id. What we need is the final component presentation.

Each page will show 20 News. Right now we need to do 20 times API call to load each Id correspond component presentation. Is there any way we can input all 20 ids and get all of their component presentation out? All of them should use the same template id.

1
  • 1
    Think of implementing SI4T or SS4T? Oct 20, 2016 at 10:11

1 Answer 1

4

I don't see that the ComponentPresentationFactory has any methods which accept an array of component IDs that would return you multiple ComponentPresentations. There are two methods which accept a Keyword or Keywords which could possibly be used if you are classifying your news components?

Many implementations do this kind of querying for multiple pieces of content, particularly with ordered and paginated things like news. With suitable caching enabled I think performance issues can be overcome.

There may be a way to query the Content Service directly rather than using CIL or the legacy CD API (whichever you're using) so that it returns multiple ComponentPresentations from a single request, but I've never needed tried it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.