How Do You Create a New Content Page With an ImpEx File?

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.

Marc Raygoza

Marc is the Founder of HybrisArchitect.com.
He enjoys helping others learn more about SAP Commerce Cloud (Hybris). Marc is a SAP Commerce Certified Professional and has held the role of SAP Commerce Cloud Architect at Deloitte, PwC, Brillio (a Bain Company), and Nasty Gal. Marc holds an M.S. Software Engineering from Carnegie Mellon University and a B.S. in Accountancy from California State University, Fresno. He can be reached at: mraygoza@hybrisarchitect.com

You may also like...

Popular Posts