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

  • 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. – Rick Pannekoek Jun 4 '18 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. – Rick Pannekoek Jun 4 '18 at 6:32
  • Yes I know, it was only for debugging purposes. How could I change Log Level in Template Builder? – tfinez Jun 4 '18 at 13:49
  • You change the Log Level using the menu: Debug/Logging Options/Log level – Rick Pannekoek Jun 5 '18 at 6:41
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)

  • 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 '18 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/… – Rick Pannekoek Jun 7 '18 at 6:35
  • What happens with keywords related to a dynamic component? – tfinez Jun 19 '18 at 17:28
  • Should work the same, but apparently there is currently an issue with that scenario. – Rick Pannekoek Jun 19 '18 at 18:07
  • I created this issue in github :) – tfinez Jun 20 '18 at 12:04

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.