You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Mahsum Demir (JIRA)" <ji...@apache.org> on 2019/01/12 21:51:00 UTC

[jira] [Created] (SLING-8210) Support page templates to be json object

Mahsum Demir created SLING-8210:
-----------------------------------

             Summary: Support page templates to be json object
                 Key: SLING-8210
                 URL: https://issues.apache.org/jira/browse/SLING-8210
             Project: Sling
          Issue Type: New Feature
          Components: App CMS
            Reporter: Mahsum Demir


Currently page templates only support escaped json strings but these strings are hard to change so I propose making page templates json objects.

 

For example, rather than writing:

 
{code:java}
"template": "{\r\n \"jcr:primaryType\": \"sling:Page\",\r\n \"jcr:content\": {\r\n \"jcr:primaryType\": \"nt:unstructured\",\r\n \"jcr:title\": \"title\",\r\n \"sling:template\": \"/conf/global/site/templates/base-page\",\r\n \"sling:resourceType\": \"reference/components/pages/base\",\r\n \"published\": false\r\n }\r\n}"
{code}
 

we will write:
{code:java}
        "template": {
          "jcr:primaryType": "sling:Page",
          "jcr:content": {
            "jcr:primaryType": "nt:unstructured",
            "jcr:title": "{{title}}",
            "sling:template": "/conf/blog/site/templates/blog-post",
            "sling:resourceType": "blog/pages/blog-post",
            "published": false,
            "container": {
              "blog_post_header": {
                "sling:resourceType": "blog/components/blog-header"
              }
            }
          }
        }
{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)