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:58:00 UTC

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

    [ https://issues.apache.org/jira/browse/SLING-8210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16741415#comment-16741415 ] 

Mahsum Demir commented on SLING-8210:
-------------------------------------

I created a PR at [https://github.com/apache/sling-org-apache-sling-app-cms/pull/4] for that feature 

> CMS - 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
>            Priority: Minor
>
> 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)