CMS pages are laid out according to their page template.
CMS 页面根据其template被布局。
在 SAP Commerce Accelerator项目里,一个page template包含下列内容:
比如下图的含义,landing page 1 template只允许包含Content Page和Category Page.
首先定义page template本身:
INSERT_UPDATE PageTemplate;$contentCV[unique=true];uid[unique=true];name;frontendTemplateName;restrictedPageTypes(code);active[default=true]
;;ContentPage2Template;Content Page 2 Template;layout/contentLayout2Page;ContentPage
然后定义content slot:
INSERT_UPDATE ContentSlotName;name[unique=true];template(uid,$contentCV)[unique=true][default='ContentPage2Template'];validComponentTypes(code)
;SiteLogo;;CMSImageComponent,BannerComponent
;HeaderLinks;;CMSLinkComponent,CMSParagraphComponent
;MiniCart;;MiniCartComponent
;NavigationBar;;NavigationComponent
;Section1;;$wideContent
;Section2;;$wideContent
;Section3;;$narrowContent
;Footer;;CMSLinkComponent,CMSParagraphComponent,FooterNavigationComponent
在impex的value区域我们并没有提供template信息,而是使用了默认的ContentPage2Template.
每个content slot都不是能够显示任何类型的Component,而是通过做了指定。比如,SiteLogo contentslot,只允许放置CMSImageComponent和BannerComponent.
Contentslot和page template的从属关系:
INSERT_UPDATE ContentSlotForTemplate;$contentCV;uid[unique=true];position[unique=true];pageTemplate(uid,$contentCV)[unique=true][default='ContentPage2Template'];contentSlot(uid,$contentCV)[unique=true];allowOverwrite
;;SiteLogo-ContentPage2;SiteLogo;;SiteLogoSlot;true
;;HomepageLink-ContentPage2;HomepageNavLink;;HomepageNavLinkSlot;true
;;NavigationBar-ContentPage2;NavigationBar;;NavigationBarSlot;true
;;MiniCart-ContentPage2;MiniCart;;MiniCartSlot;true
;;Footer-ContentPage2;Footer;;FooterSlot;true
;;HeaderLinks-ContentPage2;HeaderLinks;;HeaderLinksSlot;true
这个从属关系也能在Backoffice查看: