PageRenderTime 34ms CodeModel.GetById 30ms RepoModel.GetById 1ms app.codeStats 0ms

/en/developer/frameworks/articles/front-end-development/02-themes/07-managing-theme-resources/02-creating-a-sitemap/01-creating-a-sitemap-intro.markdown

https://github.com/JorgeFerrer/liferay-docs
Markdown | 219 lines | 212 code | 7 blank | 0 comment | 0 complexity | 25efc5a34bd06a9995836652b8094d31 MD5 | raw file
  1. ---
  2. header-id: creating-a-sitemap-for-the-resources-importer
  3. ---
  4. # Creating a Sitemap for the Resources Importer
  5. [TOC levels=1-4]
  6. You have two options for specifying resources to be imported with your theme: a
  7. sitemap or an [archive LAR file](/docs/7-2/frameworks/-/knowledge_base/f/archiving-your-sites-resources).
  8. Using a `sitemap.json` file is the most flexible approach, so we recommend it;
  9. unlike LAR files, a `sitemap.json` can be created in one version of @product@
  10. and used in another. LAR files are version-specific, and can only be imported in
  11. the same version in which they were created.
  12. | **Important:** The Resources Importer is deprecated as of @product-ver@ 7.1.
  13. |
  14. |
  15. The `sitemap.json` specifies the site pages, layout templates, web content,
  16. assets, and portlet configurations provided with the theme. This file describes
  17. the contents and hierarchy of the site to import as a site or site template. If
  18. you're developing themes for Liferay Marketplace, you must use the
  19. `sitemap.json` to specify resources to be imported with your theme. Even if
  20. you're not familiar with JSON, the `sitemap.json` file is easy to understand. An
  21. example `sitemap.json` file is shown below:
  22. ```json
  23. {
  24. "layoutTemplateId": "2_columns_ii",
  25. "privatePages": [
  26. {
  27. "friendlyURL": "/private-page",
  28. "name": "Private Page",
  29. "title": "Private Page"
  30. }
  31. ],
  32. "publicPages": [
  33. {
  34. "columns": [
  35. [
  36. {
  37. "portletId": "com_liferay_login_web_portlet_LoginPortlet"
  38. },
  39. {
  40. "portletId":
  41. "com_liferay_site_navigation_menu_web_portlet_SiteNavigationMenuPortlet"
  42. },
  43. {
  44. "portletId":
  45. "com_liferay_journal_content_web_portlet_JournalContentPortlet",
  46. "portletPreferences": {
  47. "articleId": "Without Border.html",
  48. "groupId": "${groupId}",
  49. "portletSetupPortletDecoratorId": "borderless"
  50. }
  51. },
  52. {
  53. "portletId": "com_liferay_journal_content_web_portlet_JournalContentPortlet",
  54. "portletPreferences": {
  55. "articleId": "Custom Title.html",
  56. "groupId": "${groupId}",
  57. "portletSetupPortletDecoratorId": "decorate",
  58. "portletSetupTitle_en_US": "Web Content Display with Custom Title",
  59. "portletSetupUseCustomTitle": "true"
  60. }
  61. }
  62. ],
  63. [
  64. {
  65. "portletId": "com_liferay_hello_world_web_portlet_HelloWorldPortlet"
  66. },
  67. {
  68. "portletId":
  69. "com_liferay_site_navigation_menu_web_portlet_SiteNavigationMenuPortlet_INSTANCE_${groupId}",
  70. "portletPreferences": {
  71. "displayStyle": "[custom]",
  72. "headerType": "root-layout",
  73. "includedLayouts": "all",
  74. "nestedChildren": "1",
  75. "rootLayoutLevel": "3",
  76. "rootLayoutType": "relative"
  77. }
  78. },
  79. "Web Content with Image.html",
  80. {
  81. "portletId": "com_liferay_nested_portlets_web_portlet_NestedPortletsPortlet",
  82. "portletPreferences": {
  83. "columns": [
  84. [
  85. {
  86. "portletId":
  87. "com_liferay_journal_content_web_portlet_JournalContentPortlet",
  88. "portletPreferences": {
  89. "articleId": "Child Web Content 1.xml",
  90. "groupId": "${groupId}",
  91. "portletSetupPortletDecoratorId": "decorate",
  92. "portletSetupTitle_en_US":
  93. "Web Content Display with Child Structure 1",
  94. "portletSetupUseCustomTitle": "true"
  95. }
  96. }
  97. ],
  98. [
  99. {
  100. "portletId":
  101. "com_liferay_journal_content_web_portlet_JournalContentPortlet",
  102. "portletPreferences": {
  103. "articleId": "Child Web Content 2.xml",
  104. "groupId": "${groupId}",
  105. "portletSetupPortletDecoratorId": "decorate",
  106. "portletSetupTitle_en_US":
  107. "Web Content Display with Child Structure 2",
  108. "portletSetupUseCustomTitle": "true"
  109. }
  110. }
  111. ]
  112. ],
  113. "layoutTemplateId": "2_columns_i"
  114. }
  115. }
  116. ]
  117. ],
  118. "friendlyURL": "/home",
  119. "nameMap": {
  120. "en_US": "Welcome",
  121. "fr_FR": "Bienvenue"
  122. },
  123. "title": "Welcome"
  124. },
  125. {
  126. "columns": [
  127. [
  128. {
  129. "portletId": "com_liferay_login_web_portlet_LoginPortlet"
  130. }
  131. ],
  132. [
  133. {
  134. "portletId": "com_liferay_hello_world_web_portlet_HelloWorldPortlet"
  135. }
  136. ]
  137. ],
  138. "friendlyURL": "/layout-prototypes-parent-page",
  139. "layouts": [
  140. {
  141. "friendlyURL": "/layout-prototypes-page-1",
  142. "layoutPrototypeLinkEnabled": "true",
  143. "layoutPrototypeUuid": "371647ba-3649-4039-bfe6-ae32cf404737",
  144. "name": "Layout Prototypes Page 1",
  145. "title": "Layout Prototypes Page 1"
  146. },
  147. {
  148. "friendlyURL": "/layout-prototypes-page-2",
  149. "layoutPrototypeUuid": "c98067d0-fc10-9556-7364-238d39693bc4",
  150. "name": "Layout Prototypes Page 2",
  151. "title": "Layout Prototypes Page 2"
  152. }
  153. ],
  154. "name": "Layout Prototypes",
  155. "title": "Layout Prototypes"
  156. },
  157. {
  158. "columns": [
  159. [
  160. {
  161. "portletId": "com_liferay_login_web_portlet_LoginPortlet"
  162. }
  163. ],
  164. [
  165. {
  166. "portletId": "com_liferay_hello_world_web_portlet_HelloWorldPortlet"
  167. }
  168. ]
  169. ],
  170. "friendlyURL": "/parent-page",
  171. "layouts": [
  172. {
  173. "friendlyURL": "/child-page-1",
  174. "name": "Child Page 1",
  175. "title": "Child Page 1"
  176. },
  177. {
  178. "friendlyURL": "/child-page-2",
  179. "name": "Child Page 2",
  180. "title": "Child Page 2"
  181. }
  182. ],
  183. "name": "Parent Page",
  184. "title": "Parent Page"
  185. },
  186. {
  187. "friendlyURL": "/url-page",
  188. "name": "URL Page",
  189. "title": "URL Page",
  190. "type": "url"
  191. },
  192. {
  193. "friendlyURL": "/link-page",
  194. "name": "Link to another Page",
  195. "title": "Link to another Page",
  196. "type": "link_to_layout",
  197. "typeSettings": "linkToLayoutId=1"
  198. },
  199. {
  200. "friendlyURL": "/hidden-page",
  201. "name": "Hidden Page",
  202. "title": "Hidden Page",
  203. "hidden": "true"
  204. }
  205. ]
  206. }
  207. ```
  208. If you don't understand the sitemap at this point, don't worry. This section
  209. covers how to create a sitemap for your theme, from
  210. [defining pages](/docs/7-2/frameworks/-/knowledge_base/f/defining-layout-templates-and-pages-in-a-sitemap)
  211. to
  212. [defining portlets](/docs/7-2/frameworks/-/knowledge_base/f/defining-portlets-in-a-sitemap).