Expand my Community achievements bar.

Who Me Too'd this topic

Avatar

Level 3

Hi I have created a content fragment and I am exporting the json of this content fragment on a page by adding model.json in the url (e.g. https://localhost/content/we-retail/us/en/experience/testpage.model.json). This gives me a complete json of the content fragment on the page -

{

  "title": "testpage",

  "lastModifiedDate": 1550740163226,

  "templateName": "content-page",

  "cssClassNames": "page basicpage",

  "language": "en-US",

  ":itemsOrder": [

    "root"

  ],

  ":items": {

    "root": {

      "columnCount": 12,

      "gridClassNames": "aem-Grid aem-Grid--12 aem-Grid--default--12",

      ":itemsOrder": [

        "responsivegrid"

      ],

      ":items": {

        "responsivegrid": {

          "columnClassNames": "aem-GridColumn aem-GridColumn--default--12",

          "columnCount": 12,

          "gridClassNames": "aem-Grid aem-Grid--12 aem-Grid--default--12",

          ":itemsOrder": [

            "breadcrumb",

            "contentfragment"

          ],

          ":items": {

            "breadcrumb": {

              "columnClassNames": "aem-GridColumn aem-GridColumn--default--12",

              "items": [

               

              ],

              ":type": "weretail/components/content/breadcrumb"

            },

            "contentfragment": {

              "columnClassNames": "aem-GridColumn aem-GridColumn--default--12",

              ":type": "dam/cfm/components/contentfragment",

              "text": "\n\n\n\n            Upon completing an order, you will be e-mailed a copy of your order to your registered e-mail address.\nYou can find the status of your order by logging in to your account on our Web site and select My Account \u003E My Open Orders. Select the order in question for details.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",

              "fileReference": "/content/dam/cox/firstphasesamplecf",

              "paragraphScope": "all",

              "variation": "master",

              "element": "ans"Feike Visser

            }

          },

          ":type": "wcm/foundation/components/responsivegrid"

        }

      },

      ":type": "wcm/foundation/components/responsivegrid"

    }

  },

  ":type": "weretail/components/structure/page"

}

My query here is that I want to make some changes in the structure of the json format. For example - I want to modify names or ID values for the objects that are children of the “items” objects i.e., change the name of the “root”, "text" or "image" objects or give them a string “id” property that would allow me to identify each as a seperate json property. Also I want to remove some of the json values such as gridclassNames, columnclassNames etc.

1698424_pastedImage_5.png

Is there a way to do this? I am unable to understand that how is the "root" node created and how can it be modified?

Regards,

Bernadine

Feike Vissersmacdonald2008

Who Me Too'd this topic