ImpEx files may create new content pages in Hybris Commerce. In this tutorial, we will create the ImpEx for creating a new “Contact Us” page.
Here's the ImpEx for creating a new "Contact Us" Page:
$contentCatalog=yourContentCatalog
$contentCV=catalogVersion(CatalogVersion.catalog (Catalog.id[default=$contentCatalog]), CatalogVersion.version[default=Staged]) [default=$contentCatalog:Staged]
INSERT_UPDATE ContentPage;$contentCV[unique=true];uid[unique=true]; name;masterTemplate(uid,$contentCV);label; defaultPage[default='true']; approvalStatus(code)[default='approved']; homepage[default='false'];previewImage(code, $contentCV)[default='ContentPageModel__function_preview'];; contact;Contact Us;ContentPage2Template;/contact
ImpEx Review:
- $contentCatalog: The variable name that contains the name of the desired content catalog the "Contact Us" page should belong to.
- $contentCV: The variable name that contains the name of the desired catalog version. Hybris best practice is to set the catalog version to Staged when writing your ImpEx files/scripts.
- uid: The Hybris unique system identifier for the "Contact Us" page.
- name: The user friendly name for the "Contact Us" page.
- masterTemplate: The JSP template used for "Contact Us" page; these are typically defined in cms-‐content.impex.
- label: The URL of the "Contact Us" page. The forward slash in front of the label (page name) is very important, which creates a relative link to the site's root.
This concludes the tutorial for creating a content page with an ImpEx file.