How to Create Templates

          CQ5 page templates are simply models used to create new pages. They can contain as little, or as much, initial content as needed, their role being to create the correct initial node structures, with the required properties (primarily sling:resourceType) set to allow editing and rendering.

          Creating a new Template (based on an existing template)

          Needless to say a new template can be created completely from scratch, but often an existing template will be copied and updated to save you time and effort. For example, the templates within Geometrixx can be used to get you started.

          1. Copy an existing template (preferably with a definition as close as possible to what you want to achieve) to a new node.

            [Note] Note

            Templates are usually stored in /apps/<website-name>/templates/<template-name>.

          2. Change the jcr:title of the new template node to reflect its new role. You can also update the jcr:description if appropriate.

          3. Copy the component on which the template is based (this is indicated by the sling:resourceType property of the jcr:content node within the template) to create a new instance.

            [Note] Note

            Components are usually stored in /apps/<website-name>/components/<component-name>.

          4. Update the jcr:title and jcr:description of the new component.

          5. Replace the thumbnail.png if you want a new thumbnail picture to be shown in the template selection list.

          6. Update the sling:resourceType of the template's jcr:content node to reference the new component.

          7. Make any further changes to the functionality or design of the template and/or its underlying component.

            Changes made to the /apps/<website>/templates/<template-name> node will affect the template instance (as in the selection list).

            Changes made to the /apps/<website>/components/<component-name> node will affect the content page created when the template is used.

          You can now create a page within your website using the new template.



          眼鏡蛇

          posted on 2013-06-25 15:50 眼鏡蛇 閱讀(211) 評論(0)  編輯  收藏 所屬分類: CQ5

          <2025年6月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345

          導航

          統計

          常用鏈接

          留言簿(6)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 罗甸县| 揭阳市| 汾阳市| 嵩明县| 屯门区| 乌鲁木齐县| 民权县| 宁城县| 香河县| 天峨县| 定州市| 老河口市| 绥滨县| 兴义市| 循化| 登封市| 黎城县| 秦皇岛市| 沾化县| 确山县| 商河县| 东至县| 东辽县| 科尔| 永川市| 呼玛县| 安顺市| 东方市| 大悟县| 馆陶县| 安达市| 城口县| 林口县| 墨脱县| 石门县| 图们市| 合作市| 吉林省| 岳池县| 泰来县| 四子王旗|