1

In a static publishing solution we have a magazine with a page for a Month / Year and currently at publish time, the index page gets a list of all the other Pages in the same Structure Group. Works well.

Now, when moving to DXA 2.0, we need the same functionality. Some ideas are to update the Component content (move the existing Date field to MetaData or create 2 new Keyword fields - one for Month, one for Year) and then mark the ComponentTemplate as a Dynamic CT, and publish the Pages again, and now the (Dynamic) Component Presentations would exist in the Broker with Queryable Metadata.

We could also 'hack' the Page JSON and push there the list of Magazine Articles for the month, and the info would be there for the frontend.

Another idea is to write a script and add the Component Presentations of the article items to the Magazine Issue Index Page, and then they're available at the frontend in DXA.

However, is there another way to closely follow the existing static solution and also query in the frontend, and not require the above changes? I understand how we can publish the URL of the Magazine Issue Index page as a JSON property. But, what about getting the list of other Pages in the same directory structure? I am not familiar enough yet with the new Model Service in DXA 2.0 and if it would support such a query. Ideas?

3

The DXA 2.0 Model Service does not support any custom queries and is not intended as public API. Custom queries should be done using the CIL (like in DXA 1.x) and that gives you all the CD Query Capabilities.

Unfortunately, querying on Structure Group is not possible on CD-side (yet). You can query on Taxonomy, though.

So, you could create an “Edition” (Year/Month) Taxonomy and classify your Pages using that Taxonomy. This will give you dynamic querying: no need to republish the index Pages if new Pages are added.

If you really want to stick to the static publishing model, you could consider creating a custom Page Model Builder which hooks into the CM-side Model Builder Pipeline and post-processes the Page Models. It can detect your index pages by their title or Page Template, run a query to find Pages in the same SG and a create Entity Models (representing a link) for those Pages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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