前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >SAP Commerce Cloud CMS page 和 page template 的概念

SAP Commerce Cloud CMS page 和 page template 的概念

作者头像
Jerry Wang
发布2021-04-07 16:13:58
4210
发布2021-04-07 16:13:58
举报

CMS pages are laid out according to their page template.

CMS 页面根据其template被布局。

在 SAP Commerce Accelerator项目里,一个page template包含下列内容:

  • A list of content slots predefined for the template. Template里预定义的content slot列表。
  • A FrontendTemplateName that corresponds to the name of a JSP that drives the layout of the page. 一个FrontendTemplateName,对应了一个同名的JSP文件,该文件负责定义页面的内容。
  • A list of PageTypes that the template is restricted to.

比如下图的含义,landing page 1 template只允许包含Content Page和Category Page.

  • A VelocityTemplate to specify the layout in SmartEdit.

如何定义一个新的page template

首先定义page template本身:

代码语言:javascript
复制
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:

代码语言:javascript
复制
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的从属关系:

代码语言:javascript
复制
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查看:

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2021-04-01 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 如何定义一个新的page template
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档