3

My page contains a component presentation that embeds two sub levels of components as depicted below:

Page -> Component Level One -> Component Level Two -> Component Level Three

When I add a Multimedia field to "Component Level Two" it gets expanded when I preview the page:

“myMultimediaField": {
    "$type": "EntityModelData",
    "Id": "21565",
    "Namespace": "tcm",
    "ComponentTemplate": {
        "Id": "10581",
        "Namespace": "tcm",
        "RevisionDate": "0001-01-01T00:00:00"
    },
    "Folder": {
        "Id": "3743",
        "Title": “Folder for Multimedia Components"
    },
    "BinaryContent": {
        "Url": "/Preview/en/Images/my-mm-component.jpg",
        "FileName": "my-mm-component.jpg",
        "FileSize": 20844,
        "MimeType": "image/jpeg"
    },
    "SchemaId": "10418"
}

However, when I add the exact same field to "Component Level Three" it does not get expanded:

"myMultimediaField": {
    "$type": "EntityModelData",
    "Id": "21565",
    "Namespace": "tcm"
}

I've tried:

  • Updating the "DXA Resolver Recursion Depth" in "DXA Settings".
  • Setting <Parameters><expandLinkDepth>5</expandLinkDepth></Parameters> in the component template "Render Component Content".
  • Setting <Parameters><expandLinkDepth>5</expandLinkDepth></Parameters> in the page template "Render Page Content".

Any more ideas folks?

We're on DXA 2.0 + Sites 9.1

2 Answers 2

1

Increasing Generate DXA R2 Page Model template parameter expandLinkDepth to 3 in Render Page Content TBB solve the issue

<expandLinkDepth xmlns="http://www.sdl.com/web/schemas/dynamicpage">3</expandLinkDepth>
1
  • Thanks @swami, Indeed - increasing the expandLinkDepth in the "Render Page Content" TBB did the trick. Commented Dec 4, 2020 at 14:56
2

It does look like you reached the configured expansion depth.

If you debug the template in Template Builder (with Debug logging enabled), you will get more insight in why Entity Models are not expanded.

Note that there is a third place where link expansion depth can be configured: in the “Generate Data Presentation” TBB.

Furthermore, your implementation may not use the predefined “Render Component/Page Content” TBBs everywhere, but invoke “Generate DXA R2 Entity/Page Model” TBBs directly from Component/Page Templates (or maybe indirectly through some custom Compound TBB).

For clarity: the DXA Resolver recursion depth setting has no impact on link expansion at all. This merely affects resolving of Data Presentations (if you use those in the first place). If you’re not using Data Presentations, it is recommended to set this to 0 (to not waste performance in resolving).

2
  • Thanks very much Rick. Our Page Template was using the "Render Page Content" tbb. Adding the expandLinkDepth to the TBB worked Commented Dec 4, 2020 at 14:57
  • So your initial claim that you changed the "Render Page Content" TBB was false? :-) Commented Dec 8, 2020 at 11:23

Your Answer

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

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