Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Rename macro 'n' to 'mgnl-n'.

...

Advanced Tables - Table Plus
heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名

Mgnl f
pages

 

Mgnl f
components

 

 

Table of Contents

...

Advanced Tables - Table Plus
heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名

 

Mgnl f
pages pages

 

Mgnl f
demo-features

 

Mgnl n
stkHome

 

Mgnl n
stkSection

 

Mgnl n
stkArticle

 

这些模板可供编辑者在页面应用里选择使用。它们可以出现在页面应用的模板下拉菜单里,只需要:

...

Section
Column
width33%

模板原型

Advanced Tables - Table Plus
heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名

Mgnl n
default

 

Mgnl n
templates

 

Mgnl n
prototype

 

Mgnl n
areas

 

Mgnl n
main

 

Mgnl n
areas

 

Mgnl n
intro

 

Mgnl n
areas

 

Mgnl n
infoBlock

 
Column
width33%

模板定义

Advanced Tables - Table Plus
heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名
Mgnl f
pages
 

Mgnl n
stkEvent

 

Mgnl n
areas

 

Mgnl n
main

 

Mgnl n
areas

 

Mgnl n
intro

 

Mgnl n
areas

 

Mgnl n
infoBlock

 

为了使模板具有唯一性,您可以在模板定义里:

...

  • class节点里分配的STKPage定义基本模板定义。
  • modelClass节点里分配的STKPageModel是基本页面模型,提供页面级功能。它扩展了STKPage
  • renderType节点下值为stk时,分配的STK专用绘制器,STKRenderer。所有STK模板(页面和组件)都可以使用这个绘制器。
  • i18nBasename节点下分配的国际化关键字,info.magnolia.module.templatingkit.messages。这也是STK翻译的消息包关键字。
  • visible属性设置为true,使编辑者在页面应用里可以选择该模板。

    Advanced Tables - Table Plus
    heading0
    multiplefalse
    enableHeadingAttributesfalse
    enableSortingfalse
    classm5-configuration-tree
    enableHighlightingfalse
    节点名

     

    Mgnl f
    pages pages

     

    Mgnl n
    stkArticle

     

    Mgnl n
    areas

     

    mgnl-p
    bodyID

    article

    mgnl-p
    category

    content

    mgnl-p
    class

    info.magnolia.module.templatingkit.templates.pages.STKPage

    mgnl-p
    dialog

    standard-templating-kit:pages/article/stkArticleProperties

    mgnl-p
    i18nBasename

    info.magnolia.module.templatingkit.messages

    mgnl-p
    modelClass

    info.magnolia.module.templatingkit.templates.pages.STKPageModel

    mgnl-p
    renderType

    stk

    mgnl-p
    subcategory

    article

    mgnl-p
    title

    templates.stkArticle.title

    mgnl-p
    visible

    true

有两个例外:

  • stkGlossary模板使用它自己的modelClass,即GlossaryTemplateModel,这个模型类通过扩展STKPageModel<STKPage>来完成按字母排序的词汇表。

    Advanced Tables - Table Plus
    heading0
    multiplefalse
    enableHeadingAttributesfalse
    enableSortingfalse
    classm5-configuration-tree
    enableHighlightingfalse
    节点名

     pages 

    Mgnl f
    pages

     

    Mgnl n
    stkGlossary

     

    Mgnl n
    areas

     

    mgnl-p
    bodyID

    glossary

    mgnl-p
    category

    feature

    mgnl-p
    class

    info.magnolia.module.templatingkit.templates.pages.STKPage

    mgnl-p
    dialog

    standard-templating-kit:pages/glossary/stkGlossaryProperties

    mgnl-p
    i18nBasename

    info.magnolia.module.templatingkit.messages

    mgnl-p
    modelClass

    info.magnolia.module.templatingkit.templates.GlossaryTemplateModel

    mgnl-p
    renderType

    stk

    mgnl-p
    subcategory

    glossary

    mgnl-p
    title

    templates.stkGlossary.title

    mgnl-p
    visible

    true
  • stkRedirect模板使用它自己的:
    • modelClassRedirectTemplateModel,这个模型类扩展了STKPageModel,并提供3个可选的重定向模式。编辑者可以通过以下方式之一设置path值来选择模式:
      • 如果在对话框里输入了内部路径或外部URL,用户将会直接被重定向过去。为避免写入响应,绘制步骤会被跳过。
      • 如果没有输入路径,那么页面会重定向至找到的第一个子页面。这有利于直接显示一个在重定向树的二级或三级定义的页面。
      • templateScript:redirectMain.ftl,在页面上绘制合适的路径。您可以在STK 模板 /templating-kit/pages/functional/redirectMain.ftl里查看脚本。

        Advanced Tables - Table Plus
        heading0
        multiplefalse
        enableHeadingAttributesfalse
        enableSortingfalse
        classm5-configuration-tree
        enableHighlightingfalse
        节点名

         pages

         

        Mgnl f
        pages

         

        Mgnl n
        stkRedirectstkRedirect

         

        Mgnl n
        areas

         

        mgnl-p
        bodyID

        redirect

        mgnl-p
        category

        functional

        mgnl-p
        class

        info.magnolia.module.templatingkit.templates.pages.STKPage

        mgnl-p
        dialog

        standard-templating-kit:functional/stkRedirect

        mgnl-p
        i18nBasename

        info.magnolia.module.templatingkit.messages

        mgnl-p
        modelClass

        info.magnolia.module.templatingkit.templates.RedirectTemplateModel

        mgnl-p
        renderType

        stk

        mgnl-p
        subcategory

        redirect

        mgnl-p
        templateScript

        /templating-kit/pages/functional/redirectMain.ftl

        mgnl-p
        title

        templates.stkRedirect.title

        mgnl-p
        visible

        true

在页面编辑器里,页面显示到内部或外部重定向的路径,但在预览里,则显示目标页面。/demo-project/service/m5-campaign页面使用的是stkRedirect模板。

...

  • bodyID:这是模板专有样式的CSS表所用的标签。参考Body类和ID以获得更多信息。bodyIDsubcategory值常常会一致,但它们彼此之间没有依赖关系。
  • categorysubcategory:每个模板都会分配到一个类别里,同时大多数模板也会分配到子类。很多场合都使用了类别,参考类别和子类
  • dialog:每个页面模板会连接到它自己的stk<Template name>Properties对话框,这个对话框在STK > 对话框定义 /pages里配置。页面顶部工具栏里的属性按钮可以打开此对话框,控制浏览器标题和导航标题及行为,页面元数据(关键字和描述),变异形式排除和页面依赖性。详细信息参看属性对话框
  • title:在页面应用的模板下拉菜单里显示的模板标题。

    Advanced Tables - Table Plus
    heading0
    multiplefalse
    enableHeadingAttributesfalse
    enableSortingfalse
    classm5-configuration-tree
    enableHighlightingfalse
    节点名

     

    Mgnl f
    pages pages

     

    Mgnl n
    stkImageGallery

     

    Mgnl n
    areas

     

    mgnl-p
    bodyID

    image-gallery

    mgnl-p
    category

    feature

    mgnl-p
    class

    info.magnolia.module.templatingkit.templates.pages.STKPage

    mgnl-p
    dialog

    standard-templating-kit:pages/imageGallery/stkImageGalleryProperties

    mgnl-p
    i18nBasename

    info.magnolia.module.templatingkit.messages

    mgnl-p
    modelClass

    info.magnolia.module.templatingkit.templates.pages.STKPageModel

    mgnl-p
    renderType

    stk

    mgnl-p
    subcategory

    imageGallery

    mgnl-p
    title

    templates.stkImageGallery.title

    mgnl-p
    visible

    true

Anchor
页面定义
页面定义
extends属性

Magnolia CMS使用扩展机制来最小化配置。这个机制类似于单个模板定义和原型定义之间的关系,只不过它很直观。扩展配置中只配置修改、例外和添加物,其他所有配置都照搬基本配置。

...

Advanced Tables - Table Plus
heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
stkArticle
节点名

  pages

 

Mgnl f

pages

 

Mgnl n
stkArticle

 

Mgnl n
stkLargeArticle

 

Mgnl n
stkNews

 

Mgnl n
areas

 

mgnl-p
dialog

standard-templating-kit:pages/news/stkNewsProperties

mgnl-p
extends

/modules/standard-templating-kit/templates/pages/stkArticle

mgnl-p
subcategory

news

mgnl-p
title

templates.stkNews.title

...

Advanced Tables - Table Plus
heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名

 

Mgnl f
pages pages

 

Mgnl f
demo-features

 

Mgnl n
stkSectionNoExtras

 

Mgnl n
areas

 

mgnl-p
extends

/modules/standard-templating-kit/templates/pages/stkSection

mgnl-p
title

Section no Extras

Mgnl n
stkSectionNoHeader

 

Mgnl n
stkSectionFloating

 

extends属性也可设置为override来覆写部分扩展配置。参考使组件可用中的样例。

...

Advanced Tables - Table Plus
heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名

Mgnl n
stkSection

 

Mgnl n
areas

 

Mgnl n
main

 

Mgnl n
areas

 

Mgnl n
intro

 

mgnl-p
class

info.magnolia.module.templatingkit.templates.MainAreaIntro

mgnl-p
dialog

standard-templating-kit:pages/section/stkSectionIntro

mgnl-p
divID

page-intro

mgnl-p
showAuthorDate

false

mgnl-p
showTextFeatures

false

使组件可用

...

Advanced Tables - Table Plus
heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名

Mgnl n
stkArticle

 

Mgnl n
areas

 

Mgnl n
promos

 

Mgnl n
availableComponents

 

Mgnl n
stkTextImage

 

mgnl-p
id

standard-templating-kit:components/content/stkTextImage

Mgnl n
stkQuotedText

 

mgnl-p
id

standard-templating-kit:components/content/stkQoutedText

...

  • 该模板不是任何其他模板的扩展。
  • /areas/promos/availableComponents节点的添加使Magnolia CMS了解此区域修改了原型。
  • /availableComponents/stkPromo/enabled节点禁用了此区域的stkPromo组件。
  • /availableComponents/stkExtrasContact节点里使能了stkExtrasContact组件,禁用了stkPromo组件。

    Advanced Tables - Table Plus
    heading0
    multiplefalse
    enableHeadingAttributesfalse
    enableSortingfalse
    classm5-configuration-tree
    enableHighlightingfalse
    节点名

    Mgnl n
    stkEventsOverview

     

    Mgnl n
    areas

     

    Mgnl n
    promos

     

    Mgnl n
    availableComponents

     

    Mgnl n
    stkPromo

     

    mgnl-p
    enabled

    false

    Mgnl n
    stkExtrasContact

     

    mgnl-p
    id

    standard-templating-kit:components/extras/stkExtrasContact

...

  • 该模板是stkArticle模板的扩展。这是在/stkNews/extends节点下配置的。
  • 添加/areas/content/extends属性并设置为override,就会告诉Magnolia CMS忽略(覆写)stkArticle模板里的/areas/content配置。这个配置使得8个内容组件可用。
  • 添加/areas/content/availableComponents节点,使stkNews模板里只有stkTextImage组件可用

    Advanced Tables - Table Plus
    heading0
    multiplefalse
    enableHeadingAttributesfalse
    enableSortingfalse
    classm5-configuration-tree
    enableHighlightingfalse
    节点名

    Mgnl n
    stkNews

     

    Mgnl n
    areas

     

    Mgnl n
    main

     

    Mgnl n
    areas

     

    Mgnl n
    content

     

    Mgnl n
    availableComponents

     

    Mgnl n
    stkTextImage

     

    mgnl-p
    id

    standard-templating-kit:components/content/stkTextImage

    mgnl-p
    extends

    override

    mgnl-p
    dialog

    standard-templating-kit:pages/news/stkNewsProperties

    mgnl-p
    extends

    /modules/standard-templating-kit/templates/pages/stkArticle

    mgnl-p
    subcategory

    news

    mgnl-p
    title

    templates.stkNews.title

...

  • roles内容节点提醒Magnolia CMS可能有使用限制。
  • superuser属性值也设置为superuser,限制了只有superuser角色的用户才能使用组件。详细信息参考角色RolesRoles

    Advanced Tables - Table Plus
    heading0
    multiplefalse
    enableHeadingAttributesfalse
    enableSortingfalse
    classm5-configuration-tree
    enableHighlightingfalse
    节点名

    Mgnl n
    stkArticle

     

    Mgnl n
    areas

     

    Mgnl n
    main

     

    Mgnl n
    areas

     

    Mgnl n
    content

     

    Mgnl n
    availableComponents

     

    Mgnl n
    stkHTML

     

    Mgnl n
    roles

     

    mgnl-p
    superuser

    superuser

    mgnl-p
    id

    standard-templating-kit:components/content/stkHTML

    Mgnl n
    stkTextImage

     

    Mgnl n
    stkQuotedText

     

您可以这样来测试:以样例编辑者Eric(username/password=eric)的身份登录,尝试在任意文章页面的content区域添加stkHTML组件。结果将会是,stkHTML组件在选择器对话框里不可用。

...

  • stkHomestkSection和内容模板里保持默认区域类型。从/areas/main/areas/content/availableComponents节点可以看到,stkHomestkSection模板里可使用要点,内容模板(stkArticle)里可使用内容组件。

    Section
    Column
    width33%
    Advanced Tables - Table Plus
    heading0
    multiplefalse
    enableHeadingAttributesfalse
    enableSortingfalse
    classm5-configuration-tree
    enableHighlightingfalse
    节点名

    Mgnl n
    stkHome

    Mgnl n
    areas

    Mgnl n
    main

    Mgnl n
    areas

    Mgnl n
    content

    Mgnl n
    availableComponents

    Mgnl n
    stkTeaser

    Mgnl n
    stkTeaserNewsList

    Mgnl n
    stkTeaserEventsList

    Mgnl n
    stkTeaserGroup

    Mgnl n
    stkTeaserHorizontalTabbed

    Mgnl n
    stkTeaserPureLinkList

    Column
    width33%
    Advanced Tables - Table Plus
    heading0
    multiplefalse
    enableHeadingAttributesfalse
    enableSortingfalse
    classm5-configuration-tree
    enableHighlightingfalse
    节点名

    Mgnl n
    stkArticle

    Mgnl n
    areas

    Mgnl n
    main

    Mgnl n
    areas

    Mgnl n
    content

    Mgnl n
    availableComponents

    Mgnl n
    stkTextImage

    Mgnl n
    stkQuotedText

    Mgnl n
    stkLinkList

    Mgnl n
    stkFlash

    Mgnl n
    stkVideo

    Mgnl n
    stkTeaserHorizontalTabbed

    Mgnl n
    stkDownloadList

    Mgnl n
    stkContact

  • 特性模板覆写了默认类型,将其改为single。特性组件在/areas/main/areas/content/autoGeneration/content/singleton节点里添加。参考特色组件自动生成的组件

    Advanced Tables - Table Plus
    heading0
    multiplefalse
    enableHeadingAttributesfalse
    enableSortingfalse
    classm5-configuration-tree
    enableHighlightingfalse
    节点名

    Mgnl n
    stkImageGallery

     

    Mgnl n
    areas

     

    Mgnl n
    main

     

    Mgnl n
    areas

     

    Mgnl n
    content

     

    Mgnl n
    autoGeneration

     

    Mgnl n
    content

     

    Mgnl n
    singleton

     

    mgnl-p
    maxImages

    9

    mgnl-p
    nodeType 

     mgnl:component

    mgnl-p
    templateId

     standard-templating-kit:components/features/stkImageGallery

    mgnl-p
    generatorClass

     info.magnolia.rendering.generator.CopyGenerator

    mgnl-p
    type

    single

使能区域

大多数区域在原型里是使能的,因此需要在特定的模板定义里禁用,改变默认设置。您可以将/areas/<area name>内容节点下的enabled属性节点值设置为false来做到。另一方面,类似stageplatform的区域由于很少使用,所以在原型里是不使能的,这种情况就需要设置enabled属性值为true来改变。

...

  • 决定整个区域是否绘制,无论区域包含的是组件,自动生成的内容,还是脚本绘制的内容。内容会保留在内容库中,并且在一个被禁用的区域重新使能后,将会再绘制。您可以在stkArticle模板上禁用extras,并在工具 > JCR里查看任意文章页来验证。

    Section
    Column
    width33%

    模板定义

    Advanced Tables - Table Plus
    heading0
    multiplefalse
    enableHeadingAttributesfalse
    enableSortingfalse
    classm5-configuration-tree
    enableHighlightingfalse
    节点名

    Mgnl n
    stkArticle

     

    Mgnl n
    areas

     

    Mgnl n
    extras

     

    mgnl-p
    enabled

    false

    mgnl-p
    bodyID

    article
    Column
    width33%

    JCR浏览器(网站)

    Advanced Tables - Table Plus
    heading0
    multiplefalse
    enableHeadingAttributesfalse
    enableSortingfalse
    classm5-configuration-tree
    enableHighlightingfalse
    节点名

    Mgnl f
    demo-project

     

    Mgnl f
    about

     

    Mgnl f
    subsection-articles

     

    Mgnl f
    article

     

    Mgnl n
    extras

     

    Mgnl n
    extras1

     

    Mgnl n
    0

     

    Mgnl n
    00

     
  • 对扩展模板与基本模板有着同样的作用。例如,如果您在stkArticle上禁用extras,所有内容模板上都会禁用该区域;要在您的扩展模板上使能该区域,需要在扩展模板上添加enabled属性并设置为true
  • 可能影响页面布局。以下是一些样例,样例中的结果主要是由于页面排列和内容包装的方法造成的。
    • extras被禁用时,main区域会展开占用所有的可用空间。

    • promos被禁用时,原本它占用的可用空间里什么都不会绘制。

    • basestage或是sectionHeader被禁用时,内容会上移显示,就像被禁用的区域不曾存在一样。区域在使能但不包含任何内容时,预览模式里也会发生同样的情况。下面的截图为禁用了stagestkHome模板。

...

  • /areas/main节点:
    • 使用它自己的类,SectionMainArea,来定义opener区域属性。
    • /section/mainArea.ftl脚本绘制。该脚本与默认使用的/global/mainArea.ftl脚本唯一的不同在于,它使用[@cms.area name="opener"/]标签添加了opener区域。
  • /areas/main/areas/opener节点:
    • 配置opener区域。
    • 是一个只能绘制一个组件的single区域。
    • enabledoptional的,意味着它虽然可用,但编辑者可能会选择删除它。
    • /section/opener.ftl这个标准的single区域脚本绘制。
    • availableComponents节点里设置stkTeaserOpener组件可用。

      Advanced Tables - Table Plus
      heading0
      multiplefalse
      enableHeadingAttributesfalse
      enableSortingfalse
      classm5-configuration-tree
      enableHighlightingfalse
      节点名

      Mgnl n
      stkSection

       

      Mgnl n
      areas

       

      Mgnl n
      main

       

      Mgnl n
      floating

       

      Mgnl n
      areas

       

      Mgnl n
      intro

       

      Mgnl n
      opener

       

      Mgnl n
      availableComponents

       

      Mgnl n
      stkTeaserOpener

       

      mgnl-p
      id

      standard-templating-kit:components/teasers/stkTeaserOpener

      mgnl-p
      description

      areas.templates.main.opener.description

      mgnl-p
      enabled

       true

      mgnl-p
      optional

      true

      mgnl-p
      templateScript 

       /templating-kit/pages/section/opener.ftl

      mgnl-p
      title

      areas.templates.main.opener.title

      mgnl-p
      type

      single

      Mgnl n
      content

       

      mgnl-p
      class

      info.magnolia.module.templatingkit.templates.SectionMainArea

      mgnl-p
      templateScript

      /templating-kit/pages/section/mainArea.ftl

...

  • /areas/main:
    • 使用SectionMainArea类定义浮显属性。
    • section/MainArea.ftl脚本绘制,简单的绘制所有嵌套区域。
  • areas/main/floating
    • enabled节点设置为true来使能浮显。您可以将此属性设置为false来禁用。
    • columns设置为3,告诉Magnolia CMS在三列中绘制组件。此属性可用的选项有12,和3。由于其他嵌套区域都被禁用,只有在/areas/main/areas/content/availableComponents节点下可用的组件会在main区域里绘制。
  • areas/main/areas/content
    • 使一些要点组件在/availableComponents节点里可用。这些组件被配置在一个浮显区域内工作(见下表)。
    • section/contentArea.ftl脚本绘制。该脚本包含绘制teaserCount的代码(见下表)。
  • /areas/main/areas/intro/opener/breadcrumb被禁用了,意味着在此模板上,浮显只出现在/areas/main/areas/content里。您并不一定需要禁用其他嵌套区域。
  • /areas/extras被禁用,以确保此页解析到一个allowedBodyClass里(见下表)。

    Advanced Tables - Table Plus
    heading0
    multiplefalse
    enableHeadingAttributesfalse
    enableSortingfalse
    classm5-configuration-tree
    enableHighlightingfalse
    节点名

    Mgnl n
    stkHome

     

    Mgnl n
    areas

     

    Mgnl n
    main

     

    Mgnl n
    floating

     

    mgnl-p
    columns

    3

    mgnl-p
    enabled

    true

    Mgnl n
    areas

     

    Mgnl n
    content

     

    Mgnl n
    availableComponents

     

    mgnl-p
    templateScript

    /templating-kit/pages/section/contentArea.ftl

    mgnl-p
    title

    templates.stkHome.areas.main.content.title

    Mgnl n
    intro

     

    mgnl-p
    class

    info.magnolia.module.templatingkit.templates.MainAreaIntro

    mgnl-p
    enabled

    false

    Mgnl n
    opener

     

    Mgnl n
    breadcrumb

     

    mgnl-p
    class

     info.magnolia.module.templatingkit.templates.SectionMainArea

    mgnl-p
    templateScript

    /templating-kit/pages/section/mainArea.ftl

    Mgnl n
    extras

     

    Mgnl n
    inheritance

     

    mgnl-p
    class 

    info.magnolia.module.templatingkit.templates.ExtrasArea

    mgnl-p
    enabled

    false

默认情况下,您可以扩展stkHomestkSection模板来配置一个浮显模板,这是因为它们都使用SectionMainArea类和要点组件。其它的场景则需要定制。STK > 模板定义 /pages/demo-features/stkSectionFloating里的stkSectionFloating模板就是扩展stkSection模板的一个例子,它:

  • stkSectionFloating/extends节点下扩展stkSection模板。通过扩展:
    • 需要的要点组件在/areas/main/content/availableComponents节点下可用。
    • SectionMainArea类得到使用。
  • /areas/main/floating节点,floating被使能且columns设置为2
  • /areas/main/areas节点,introopener区域被禁用。
  • /areas/extras节点,extras区域被禁用。

    Advanced Tables - Table Plus
    heading0
    multiplefalse
    enableHeadingAttributesfalse
    enableSortingfalse
    classm5-configuration-tree
    enableHighlightingfalse
    节点名
    Mgnl f
    pages
     

    Mgnl f
    demo-features

     

    Mgnl n
    stkSectionFloating

     

    Mgnl n
    areas

     

    Mgnl n
    main

     

    Mgnl n
    floating

     

    mgnl-p
    columns

    2

    mgnl-p
    enabled

    true

    Mgnl n
    areas

     

    Mgnl n
    intro

     

    mgnl-p
    enabled

    false

    Mgnl n
    opener

     

    mgnl-p
    enabled

    false

    Mgnl n
    extras

     

    Mgnl n
    inheritance

     

    mgnl-p
    class

    info.magnolia.module.templatingkit.templates.ExtrasArea

    mgnl-p
    enabled

    false

    Mgnl n
    base

     

    mgnl-p
    extends

    /modules/standard-templating-kit/templates/pages/stkSection

    mgnl-p
    title

    Section Floating

这是基于stkSectionFloating模板的demo-features/section-variables/floating页在公共实例上的样子。该页解析到body元素里包含的一个属性(attribute),即allowedBodyClass=nav-col-float2里。main区域的每个要点都包装在一个DIV元素内。

...

Advanced Tables - Table Plus
heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名
Mgnl f
pages
 

Mgnl n
stkSection

 

Mgnl n
areas

 

Mgnl n
variations

 

Mgnl n
newsletter

 

Mgnl n
areas

 

Mgnl n
sectionHeader

 

mgnl-p
enabled

false

Mgnl n
extras

 

mgnl-p
enabled

false

Mgnl n

false

promos

 

mgnl-p
enabled

false

Mgnl n
base

 

mgnl-p
enabled

false

如果您在任意基于stkSection模板的页面上,只需将扩展名从.html改为.newsletter,变异形式的内容就出现了。

...

Advanced Tables - Table Plus
heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名
Mgnl f
pages
 

Mgnl n
stkArticle

 

Mgnl n
cssFiles

 

Mgnl n
articleStyles

 

mgnl-p
farFutureCaching

true

mgnl-p
link

/resources/templating-kit/css/articleStyles.css

mgnl-p
media

screen

Mgnl n
jsFiles

 

Mgnl n
fireworks

 

mgnl-p
farFutureCaching

true

mgnl-p
link

/resources/templating-kit/js/fireworks.js

...

Advanced Tables - Table Plus
heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名

Mgnl f
components

 

Mgnl f
content

 

Mgnl f
teasers

 

Mgnl f
extras

 

Mgnl f
promos

 

Mgnl n
stkPromo

 

Mgnl f
features

 

Mgnl f
links

 

Mgnl f
stages

 

Mgnl f
footer

 

Mgnl f

 

pur

 

组件定义与页面定义相似,使用相同的模板定义对象。页面和组件使用相同路径语法引用它们的对话框。此外,页面和组件还使用相同的绘制工具绘制。

...

Advanced Tables - Table Plus
heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名

Mgnl f
components

 

Mgnl f
content

 

Mgnl n
stkQuotedText

 

mgnl-p
deletable

false

mgnl-p
description

paragraphs.content.stkQuotedText.description

mgnl-p
dialog

standard-templating-kit:components/content/stkQuotedText

mgnl-p
i18nBasename

info.magnolia.module.templatingkit.messages

mgnl-p
moveable

false

mgnl-p
renderType

stk

mgnl-p
templateScript

/templating-kit/components/content/quotedText.ftl

mgnl-p
title

paragraphs.content.stkQuotedText.title

mgnl-p
writable

true

以上配置样例中,deletablemoveablewritable属性的配置使组件可编辑,但不可移动或删除。以下为编辑者在页面编辑器里看到的。

...

Advanced Tables - Table Plus
heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名

Mgnl f
components

 

Mgnl f
teasers

 

Mgnl n
stkTeaser

 

Mgnl n
parameters

 

Mgnl n
areas

 

mgnl-p
description

paragraphs.teasers.stkTeaser.description

mgnl-p
dialog

standard-templating-kit:components/teasers/stkTeaser

mgnl-p
i18nBasename

info.magnolia.module.templatingkit.messages

mgnl-p
modelClass

info.magnolia.module.templatingkit.templates.components.InternalTeaserModel

mgnl-p
renderType

stk

mgnl-p
templateScript

/templating-kit/components/teasers/internalPage.ftl

mgnl-p
title

paragraphs.teasers.stkTeaser.title

...

Advanced Tables - Table Plus
heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名

Mgnl f
components

 

Mgnl f
teasers

 

Mgnl n
stkTeaserNewsList

 

Mgnl n
parameters

 

mgnl-p
divClass

teaser latest

mgnl-p
divIDPrefix

teaser

mgnl-p
headingLevel

h2

mgnl-p
searchForSubcategory

news

mgnl-p
teaserLinkType

internal

mgnl-p
description

paragraphs.teasers.stkTeaserNewsList.description

mgnl-p
dialog

standard-templating-kit:components/teasers/stkTeaserNewsList

mgnl-p
i18nBasename

info.magnolia.module.templatingkit.messages

mgnl-p
modelClass

info.magnolia.module.templatingkit.templates.components.NewsListModel

mgnl-p
renderType

stk

mgnl-p
templateScript

/templating-kit/components/teasers/newsList.ftl

mgnl-p
title

paragraphs.teasers.stkTeaserNewsList.title

...

Advanced Tables - Table Plus
heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名

Mgnl f
components

 

Mgnl f
teasers

 

Mgnl n
stkPureLinkList

 

Mgnl n
parameters

 

Mgnl n
areas

 

Mgnl n
linkList

 

Mgnl n
availableComponents

 

Mgnl n
stkInternalLink

 

mgnl-p
id

standard-templating-kit:components/links/stkInternalLink

Mgnl n
stkExternalLink

 

Mgnl n
stkDownloadLink

 

mgnl-p
description

areas.components.linkList.description

mgnl-p
enabled

true

mgnl-p
templateScript

/templating-kit/components/links/linkListArea.ftl

mgnl-p
title

areas.components.linkList.title

mgnl-p
type

list

mgnl-p
description

paragraphs.teasers.stkTeaserPureLinkList.description

mgnl-p
dialog

standard-templating-kit:components/teasers/stkTeaserPureLinkList

mgnl-p
i18nBasename

info.magnolia.module.templatingkit.messages

mgnl-p
renderType

stk

mgnl-p
templateScript

/templating-kit/components/teasers/pureLinkList.ftl

mgnl-p
title

paragraphs.teasers.stkTeaserPureLinkList.title

...

Code Block
…
[#list components as component ]
    [@cms.component content=component /]
[/#list]

Anchor
组件定义
组件定义
extends属性

扩展机制被广泛使用来最小化extras组件的配置。extras组件有对应的teaser组件,这两个区域绘制的组件基本相同,只有CSS样式和继承行为不一样。

...

Advanced Tables - Table Plus
heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名

Mgnl f
components

 

Mgnl f
teasers

 

Mgnl n
stkTeaserContact

 

Mgnl n
parameters

 

mgnl-p
divClass

box vcard

mgnl-p
divIDPrefix

teaser

mgnl-p
headingLevel

h2

mgnl-p
teaserLinkType

internal

mgnl-p
description

paragraphs.teasers.stkTeaserContact.description

mgnl-p
dialog

standard-templating-kit:components/teasers/stkTeaserContact

mgnl-p
i18nBasename

info.magnolia.module.templatingkit.messages

mgnl-p
modelClass

info.magnolia.module.templatingkit.templates.components.ContactModel

mgnl-p
renderType

stk

mgnl-p
templateScript

/templating-kit/components/teasers/contact.ftl

mgnl-p
title

paragraphs.teasers.stkTeaserContact.title

...

Advanced Tables - Table Plus
heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名

Mgnl f
components

 

Mgnl f
extras

 

Mgnl n
stkExtrasContact

 

Mgnl n
parameters

 

mgnl-p
divIDPrefix

box

mgnl-p
dialog

standard-templating-kit:components/extras/stkExtrasContact

mgnl-p
extends

/modules/standard-templating-kit/templates/components/teasers/stkTeaserContact

...

Advanced Tables - Table Plus
heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名

Mgnl f
pages

 

Mgnl n
stkEvent

 

Mgnl n
areas

 

Mgnl n
extras

 

Mgnl n
areas

 

Mgnl n

 

extras1

 

Mgnl n
autoGeneration

 

Mgnl n
content

 

Mgnl n
calendar

 

mgnl-p
nodeType

mgnl:component

mgnl-p
templateId

standard-templating-kit:components/extras/stkExtrasCalendar

mgnl-p
generatorClass

info.magnolia.rendering.generator.CopyGenerator

...

Advanced Tables - Table Plus
heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名

Mgnl f
pages

 

Mgnl n
stkArticle

 

Mgnl n
areas

 

Mgnl n
main

 

Mgnl n
areas

 

Mgnl n
content

 

Mgnl n
availableComponents

 

Mgnl n
autoGeneration

 

Mgnl n
content

 

Mgnl n
conference

 

mgnl-p
editHTML

<p><font color="#669900" size="+1">Sign up for the</font><font size="+1">....../strong></a>.</font> </p>

mgnl-p
nodeType

mgnl:component

mgnl-p
templateId

standard-templating-kit:components/content/stkHTML

mgnl-p
generatorClass

info.magnolia.rendering.generator.CopyGenerator

...

Advanced Tables - Table Plus
heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名

Mgnl f
components

 

Mgnl f
features

 

Mgnl n
stkSiteMap

 

mgnl-p
description

paragraphs.features.stkSiteMap.description

mgnl-p
dialog

standard-templating-kit:components/features/stkSiteMap

mgnl-p
i18nBasename

info.magnolia.module.templatingkit.messages

mgnl-p
modelClass

info.magnolia.module.templatingkit.templates.components.SiteMapParagraphModel

mgnl-p
renderType

stk

mgnl-p
templateScript

/templating-kit/components/features/siteMap.ftl

mgnl-p
title

paragraphs.features.stkSiteMap.title

...

Advanced Tables - Table Plus
heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名

Mgnl f
pages

 

Mgnl n
stkSiteMap

 

Mgnl n
areas

 

Mgnl n
main

 

Mgnl n
areas

 

Mgnl n
intro

 

Mgnl n
content

 

Mgnl n
autoGeneration

 

Mgnl n
content

 

Mgnl n
singleton

 

mgnl-p
maxLevels

3

mgnl-p
nodeType

mgnl:component

mgnl-p
showSiteMapRoot

true

mgnl-p
templateId

standard-templating-kit:components/features/stkSiteMap

mgnl-p
titleToUse

title

mgnl-p
generatorClass

info.magnolia.rendering.generator.CopyGenerator

mgnl-p
type

single

mgnl-p
class

info.magnolia.module.templatingkit.templates.MainArea

...

Advanced Tables - Table Plus
heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
节点名

Mgnl f
demo-project

 

Mgnl f
service

 

Mgnl f
site-map

 

Mgnl n
content

 

Mgnl n
singleton

 

mgnl-p
maxLevels

4

mgnl-p
showSiteMapRoot

true

mgnl-p
titleToUse

title

如果您想要在模板定义中修改一个自动生成组件的默认设置,您需要首先在JCR浏览器中删除这个内容节点(singleton)并刷新该页。系统会使用新的模板定义属性在页面上重新创建该组件。这是一个已知问题,您可以在MAGNOLIA-4482里跟踪进展。