3

A developer created a component which has two levels of linked components and finds that the lowest level component does not fully render in the JSON coming from the Component Template.

Since DXA is based on DD4T which can be configured to do this, how can we set the number of levels in DXA?

2 Answers 2

7

The linking level is configurable with "expandLinkDepth" parameter in the Core Template Building Blocks "Render Page Content" and "Render Component Content"

Render Page Content

\100 Master\Building Blocks\Framework\Developer\Templates\Sdl.Web.Tridion.Templates\Render Page Content

<CompoundTemplate xmlns="http://www.tridion.com/ContentManager/5.3/CompoundTemplate">
  <TemplateInvocation>
    <Template xlink:href="tcm:2-51-2048" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:title="Generate Dynamic Page (DXA)" />
    <TemplateParameters>
      <Parameters xmlns="http://www.sdl.com/web/schemas/dynamicpage">
        <expandLinkDepth>2</expandLinkDepth>
      </Parameters>
    </TemplateParameters>
  </TemplateInvocation>
</CompoundTemplate>

Render Component Content

\100 Master\Building Blocks\Framework\Developer\Templates\Sdl.Web.Tridion.Templates\Render Component Content

<CompoundTemplate xmlns="http://www.tridion.com/ContentManager/5.3/CompoundTemplate">
  <TemplateInvocation>
    <Template xlink:href="tcm:2-71-2048" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:title="Generate Dynamic Component (DXA)" />
    <TemplateParameters>
      <Parameters xmlns="http://www.sdl.com/web/schemas/dynamiccomponent">
        <expandLinkDepth>2</expandLinkDepth>
      </Parameters>
    </TemplateParameters>
</TemplateInvocation>
</CompoundTemplate>
-1

We have the same problem with the keywords. We changed depth until 3, but we can't see the description.

"$type": "KeywordModelData[]",
  "$values": [
    {
      "Id": "610",
      "SchemaId": "608"
    },
    {
      "Id": "611",
      "SchemaId": "608"
    },
    {
      "Id": "615",
      "SchemaId": "608"
    },
    {
      "Id": "614",
      "SchemaId": "608"
    }
1
  • This is not an Answer, but a new Question. Please create a Question and provide info like DXA version. Commented May 31, 2018 at 21:10

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.