2

I have two different view model for the same schema, one view is to display a Summary page and other view is meant for a Details page.

  1. Summary page displays dynamic component presentations, which are retrieved by using getEntityModel method of DXA DefaultContentProvider.

  2. Detail page displays a regular static component presentation.

On Summary page, I want to display a (resolved) link to a detail page for every Component presentation, to achieve this I've added a field 'url' with annotation _self as described on SDL docs.

My Entity view model is defined as follows:

public class MyArticle extends AbstractEntityModel {
    private String titel;
    private RichTekst intro;
    private Date date;
    @SemanticProperty("_self")
    private String url;   
} 

My both views are displayed as expected, except I encounter a following issue:

On my Summary view, url field is empty as component link is not resolved/populated in my entity model (I can verify this in a debug mode). Other fields of the DCP do get populated and displayed as expected.

Whereas Details view with static component presentation can display url with resolved link(but obviously I don't need a resolved link here as I'm already on this page).

It seems like semantic property _self is not being recognized for the dynamic component presentations.

Or am I missing anything? any thoughts?

  • Can you provide the DXA R2 Data Model as retrieved from the DXA Model Service for both scenarios? In particular: I’m interested in the presence of an EntityModelData.LinkUrl property; this property is used to map Component Links, including the _self mapping. – Rick Pannekoek Jun 22 at 18:12

Your Answer

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

Browse other questions tagged or ask your own question.