1

When publishing a Component with a meta field that it's a keyword, the JSON only generates the following information related with the Keyword. This is the JSON generated by the CMS, debugging with Template Builder:

"$type": "KeywordModelData[]",  "$values": [
{
  "Id": "610",
  "SchemaId": "608"
},
{
  "Id": "611",
  "SchemaId": "608"
},
{
  "Id": "615",
  "SchemaId": "608"
},
{
  "Id": "614",
  "SchemaId": "608"
}

Our Component Template invokes Render Component Content, but as we didn't get the description and key, we were changing it in Template Builder by Generate DXA R2 Entity Model, in order to test the expandLinkDepth parameter. We changed to -1 (infinite) and to 2, but not success. We pasted the result that we got.

UPDATE This is the debug info. I don't understand why the keyword is not expanded if the category is publishable. Any idea? Is this a new SDL Web 8 feature?

enter image description here

4
  • Using the “Generate DXA R2 Enity Model” TBB directly in your CTs is not recommended. The purpose of the “Render Component Content” TBB inbetween is to centralize the configuration. Jun 4, 2018 at 6:30
  • Note that the DXA 2.0 TBBs provide diagnostic logging that help you understand what is happening and why. Try debugging your CT in Template Builder with Log Level set to Debug. Jun 4, 2018 at 6:32
  • Yes I know, it was only for debugging purposes. How could I change Log Level in Template Builder?
    – tfinez
    Jun 4, 2018 at 13:49
  • You change the Log Level using the menu: Debug/Logging Options/Log level Jun 5, 2018 at 6:41

1 Answer 1

1

Such Keyword JSON (only Id and SchemaId properties set) implies that the Keyword has not been expanded.

In DXA 2.0 Keywords (and Component Links) can be expanded in two ways:

  • Statically (on CM-side). This is driven by the expandLinkDepth parameter.
  • Dynamically (on CD-side; in the Model Service). This is driven by whether the Category is publishable: Keywords from a publishable Category are always expanded dynamically.

So: if the Category of the Keywords is publishable, this JSON is expected on CM-side (e.g. CM Preview). The JSON provided by the Model Service should have those Keywords expanded, though.

Note that you will have to actually publish the Category/Taxonomy for the Model Service to be able to expand those Keyword (dynamically on CD-side, using the Taxonomy APIs)

6
  • Could you check our log? We still have the same problem. Where could I find documentation about RenderComponentContent and the new way of working for KeywordDataModel? Not found anything in SDL Web 8.5 docs.
    – tfinez
    Jun 6, 2018 at 17:02
  • The log confirms that the Keywords are not expanded (on CM-side) because the Category is publishable. If you ensure the Category is published, the DXA Model Service should take care of expansion, so for yor Web Application it shouldn’t matter. This so-called Dynamic Expansion is a new feature in DXA 2.0. You can find some description of it in DXA 2.0 docs: docs.sdl.com/LiveContent/content/en-US/SDL%20DXA-v10/… Jun 7, 2018 at 6:35
  • What happens with keywords related to a dynamic component?
    – tfinez
    Jun 19, 2018 at 17:28
  • Should work the same, but apparently there is currently an issue with that scenario. Jun 19, 2018 at 18:07
  • I created this issue in github :)
    – tfinez
    Jun 20, 2018 at 12:04

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.