Skip to main content
Shortened the SDL URL and further anonymized the details.
Source Link
Paul Russell
  • 1.1k
  • 5
  • 14

The page template metadata for DXA 2.0 has a field named "htmlClasses". We have been attempting to use this in our java web app but, so far, every attempt has resulted in this field appearing as null.

The code for our page view is similar to the example provided in https://docs.sdl.com/LiveContent/content/en-US/SDL%20DXA-v4/GUID-978BB162-D5F6-41C2-B73C-8DB4124E8A4B in that we have been using the default page model and trying to load the classes field with

<jsp:useBean id="pageModel" type="com.sdl.webapp.common.api.model.PageModel" scope="request"/>
<body>
    <div class="page-row page-row-expanded ${pageModel.htmlClasses}" >
</body>

I've included the fields that are filled in in the page that we are working with.

Sample page metadata

We have confirmed that this shows up in the JSON that is rendered, by loading the page preview and also by loading the page contents from the broker.enter image description hereenter image description here

We have also confirmed that most of the JSON information is received by the page controller in Java.

The Java page controller receives all of the JSON data except for the data in the PageTemplate node. Is there any way that this data can be received by the Java app so that we can use it in our page view?

The page template metadata for DXA 2.0 has a field named "htmlClasses". We have been attempting to use this in our java web app but, so far, every attempt has resulted in this field appearing as null.

The code for our page view is similar to the example provided in https://docs.sdl.com/LiveContent/content/en-US/SDL%20DXA-v4/GUID-978BB162-D5F6-41C2-B73C-8DB4124E8A4B in that we have been using the default page model and trying to load the classes field with

<jsp:useBean id="pageModel" type="com.sdl.webapp.common.api.model.PageModel" scope="request"/>
<body>
    <div class="page-row page-row-expanded ${pageModel.htmlClasses}" >
</body>

I've included the fields that are filled in in the page that we are working with.

Sample page metadata

We have confirmed that this shows up in the JSON that is rendered, by loading the page preview and also by loading the page contents from the broker.enter image description here

We have also confirmed that most of the JSON information is received by the page controller in Java.

The Java page controller receives all of the JSON data except for the data in the PageTemplate node. Is there any way that this data can be received by the Java app so that we can use it in our page view?

The page template metadata for DXA 2.0 has a field named "htmlClasses". We have been attempting to use this in our java web app but, so far, every attempt has resulted in this field appearing as null.

The code for our page view is similar to the example provided in https://docs.sdl.com/LiveContent/content/en-US/SDL%20DXA-v4/GUID-978BB162-D5F6-41C2-B73C-8DB4124E8A4B in that we have been using the default page model and trying to load the classes field with

<jsp:useBean id="pageModel" type="com.sdl.webapp.common.api.model.PageModel" scope="request"/>
<body>
    <div class="page-row page-row-expanded ${pageModel.htmlClasses}" >
</body>

I've included the fields that are filled in in the page that we are working with.

Sample page metadata

We have confirmed that this shows up in the JSON that is rendered, by loading the page preview and also by loading the page contents from the broker.enter image description here

We have also confirmed that most of the JSON information is received by the page controller in Java.

The Java page controller receives all of the JSON data except for the data in the PageTemplate node. Is there any way that this data can be received by the Java app so that we can use it in our page view?

The page template metadata for DXA 2.0 has a field named "htmlClasses". We have been attempting to use this in our java web app but, so far, every attempt has resulted in this field appearing as null.

The code for our page view is similar to the example provided in https://docs.sdl.com/LiveContent/content/en-US/SDL%20DXA-v4/GUID-B2F0F8D0-95BF-4478-9805-A7E8B0232AA3#addHistory=true&filename=GUID-92CCBE97-76B6-4513-9D43-6D3DEAE31C7F.xml&docid=GUID-978BB162-D5F6-41C2-B73C-8DB4124E8A4B&inner_id=&tid=&query=&scope=&resource=&toc=false&eventType=lcContent.loadDocGUID-978BB162-D5F6-41C2-B73C-8DB4124E8A4Bhttps://docs.sdl.com/LiveContent/content/en-US/SDL%20DXA-v4/GUID-978BB162-D5F6-41C2-B73C-8DB4124E8A4B in that we have been using the default page model and trying to load the classes field with

<jsp:useBean id="pageModel" type="com.sdl.webapp.common.api.model.PageModel" scope="request"/>
<body>
    <div class="page-row page-row-expanded ${pageModel.htmlClasses}" >
</body>

I've included the fields that are filled in in the page that we are working with.

Sample page metadata

We have confirmed that this shows up in the JSON that is rendered, by loading the page preview and also by loading the page contents from the broker.enter image description here

We have also confirmed that most of the JSON information is received by the page controller in Java.

The Java page controller receives all of the JSON data except for the data in the PageTemplate node. Is there any way that this data can be received by the Java app so that we can use it in our page view?

The page template metadata for DXA 2.0 has a field named "htmlClasses". We have been attempting to use this in our java web app but, so far, every attempt has resulted in this field appearing as null.

The code for our page view is similar to the example provided in https://docs.sdl.com/LiveContent/content/en-US/SDL%20DXA-v4/GUID-B2F0F8D0-95BF-4478-9805-A7E8B0232AA3#addHistory=true&filename=GUID-92CCBE97-76B6-4513-9D43-6D3DEAE31C7F.xml&docid=GUID-978BB162-D5F6-41C2-B73C-8DB4124E8A4B&inner_id=&tid=&query=&scope=&resource=&toc=false&eventType=lcContent.loadDocGUID-978BB162-D5F6-41C2-B73C-8DB4124E8A4B in that we have been using the default page model and trying to load the classes field with

<jsp:useBean id="pageModel" type="com.sdl.webapp.common.api.model.PageModel" scope="request"/>
<body>
    <div class="page-row page-row-expanded ${pageModel.htmlClasses}" >
</body>

I've included the fields that are filled in in the page that we are working with.

Sample page metadata

We have confirmed that this shows up in the JSON that is rendered, by loading the page preview and also by loading the page contents from the broker.enter image description here

We have also confirmed that most of the JSON information is received by the page controller in Java.

The Java page controller receives all of the JSON data except for the data in the PageTemplate node. Is there any way that this data can be received by the Java app so that we can use it in our page view?

The page template metadata for DXA 2.0 has a field named "htmlClasses". We have been attempting to use this in our java web app but, so far, every attempt has resulted in this field appearing as null.

The code for our page view is similar to the example provided in https://docs.sdl.com/LiveContent/content/en-US/SDL%20DXA-v4/GUID-978BB162-D5F6-41C2-B73C-8DB4124E8A4B in that we have been using the default page model and trying to load the classes field with

<jsp:useBean id="pageModel" type="com.sdl.webapp.common.api.model.PageModel" scope="request"/>
<body>
    <div class="page-row page-row-expanded ${pageModel.htmlClasses}" >
</body>

I've included the fields that are filled in in the page that we are working with.

Sample page metadata

We have confirmed that this shows up in the JSON that is rendered, by loading the page preview and also by loading the page contents from the broker.enter image description here

We have also confirmed that most of the JSON information is received by the page controller in Java.

The Java page controller receives all of the JSON data except for the data in the PageTemplate node. Is there any way that this data can be received by the Java app so that we can use it in our page view?

Tweeted twitter.com/StackTridion/status/1146161710136475648
Source Link
Paul Russell
  • 1.1k
  • 5
  • 14

Page template metadata in DXA - htmlClasses field is blank

The page template metadata for DXA 2.0 has a field named "htmlClasses". We have been attempting to use this in our java web app but, so far, every attempt has resulted in this field appearing as null.

The code for our page view is similar to the example provided in https://docs.sdl.com/LiveContent/content/en-US/SDL%20DXA-v4/GUID-B2F0F8D0-95BF-4478-9805-A7E8B0232AA3#addHistory=true&filename=GUID-92CCBE97-76B6-4513-9D43-6D3DEAE31C7F.xml&docid=GUID-978BB162-D5F6-41C2-B73C-8DB4124E8A4B&inner_id=&tid=&query=&scope=&resource=&toc=false&eventType=lcContent.loadDocGUID-978BB162-D5F6-41C2-B73C-8DB4124E8A4B in that we have been using the default page model and trying to load the classes field with

<jsp:useBean id="pageModel" type="com.sdl.webapp.common.api.model.PageModel" scope="request"/>
<body>
    <div class="page-row page-row-expanded ${pageModel.htmlClasses}" >
</body>

I've included the fields that are filled in in the page that we are working with.

Sample page metadata

We have confirmed that this shows up in the JSON that is rendered, by loading the page preview and also by loading the page contents from the broker.enter image description here

We have also confirmed that most of the JSON information is received by the page controller in Java.

The Java page controller receives all of the JSON data except for the data in the PageTemplate node. Is there any way that this data can be received by the Java app so that we can use it in our page view?