Creating a Page Template Using ImpEx
Using an ImpEx script is the easiest way of creating a page template.
Context
Follow the steps below:
Procedure
- Navigate the the aifwcms360addon/resources/aifwcms360addon/import/contentCatalogs/electronicsContentCatalog directory and edit the cms-content.impex file:
# ----------------------------------------------------------------------- # [y] hybris Platform # # Copyright (c) 2000-2016 SAP SE or an SAP affiliate company. # All rights reserved. # # This software is the confidential and proprietary information of SAP # ("Confidential Information"). You shall not disclose such Confidential # Information and shall use it only in accordance with the terms of the # license agreement you entered into with SAP. # ----------------------------------------------------------------------- $contentCatalog=electronicsContentCatalog $contentCV=catalogVersion(CatalogVersion.catalog(Catalog.id[default=$contentCatalog]),CatalogVersion.version[default=Staged])[default=$contentCatalog:Staged] $jarResourceCms=jar:de.hybris.aifwcms360addon.constants.Aifwcms360addonConstants&/aifwcms360addon/import/cockpits/cmscockpit # Create a new page template with only one slot for the WCMS Customer 360, no header, no footer INSERT_UPDATE PageTemplate;$contentCV[unique=true];uid[unique=true];name;frontendTemplateName;restrictedPageTypes(code);active[default=true] ;;ContentPageTemplateWCMS360;Content Page Template for WCMS Customer 360;addon:/aifwcms360addon/pages/layout/contentLayoutWCMS360Page;ContentPage UPDATE PageTemplate;$contentCV[unique=true];uid[unique=true];velocityTemplate[translator=de.hybris.platform.commerceservices.impex.impl.FileLoaderValueTranslator] ;;ContentPageTemplateWCMS360;$jarResourceCms/structure-view/ContentPageTemplateWCMS360Template.vm INSERT_UPDATE ContentSlotName;name[unique=true];template(uid,$contentCV)[unique=true][default='ContentPageTemplateWCMS360'];validComponentTypes(code);compTypeGroup(code) ;BodyContent;;CMSParagraphComponent; INSERT_UPDATE ContentSlot;$contentCV[unique=true];uid[unique=true];name;active ;;BodyContent-customer360;Body Content Slot for Customer 360;true INSERT_UPDATE ContentSlotForTemplate;$contentCV;uid[unique=true];position[unique=true];pageTemplate(uid,$contentCV)[unique=true][default='ContentPageTemplateWCMS360'];contentSlot(uid,$contentCV)[unique=true];allowOverwrite ;;BodyContent-ContentPageTemplateWCMS360;BodyContent;;BodyContent-customer360;true # Insert content in the new page based on the page template for the WCMS customer 360 INSERT_UPDATE ContentPage;$contentCV[unique=true];uid[unique=true];name;masterTemplate(uid,$contentCV);label;defaultPage[default='true'];approvalStatus(code)[default='approved'];homepage[default='false'] ;;customer360Page;Customer 360 Page;ContentPageTemplateWCMS360;/my-account/customer360 INSERT_UPDATE ContentSlotForPage;$contentCV[unique=true];uid[unique=true];position[unique=true];page(uid,$contentCV)[unique=true][default='customer360Page'];contentSlot(uid,$contentCV)[unique=true];;; ;;BodyContent-customer360;BodyContent;;BodyContent-customer360;;; - Navigate to the hybris/bin/platform directory.
- Inside that directory, set the ant environment by opening the setantenv.bat file in your command prompt.
- In the command prompt, run the ant clean all command.
- Start the hybris server by opening the hybrisserver.bat file and navigate to the http://localhost:9001 address.
- In SAP Commerce Cloud Administration Cockpit, go to
Platform
Update
. - In the Project Data Settings screen area, select aifwcms360addon, and choose Update.
Related Information