3

我正在使用 Hippo CMS 10。通过控制台,在hst:catalog我创建了hst:containeritemcomponenthst:xtype, hst:referencecomponent, hst:iconpath, hst:label
hst:referencecomponent 引用hst :workspace/hst:containers /处的hst:containercomponent 文件夹,其中包含hst:containercomponenthst:xtype设置为HST.Span

我需要容器,它可以包含(动态)可变数量的另一个不同容器。例如,我希望能够通过从目录工具栏中拖放组件来创建此结构:

<!-- this must be main container, already positioned in page -->
<div class="content">

    <!-- this should appear when I drag'n'drop component from toolbar -->
    <!-- at the same time, it must be container for other components itself -->
    <div class="row">...</div>

    <!-- this also comes from drag'n'dropped component from toolbar -->
    <!-- and also container for other components -->
    <div class="home banner">...</div>

    <!-- any amount of containers -->
    ...
    ...
</div>

通过这种方式,我应该能够动态地创建一些页面结构。是否可以?如果是,我该如何实现?如果没有,如何绕过它,这是什么想法?
HippoCMS 的站点对于此类示例非常差,除此站点外,没有关于 hippocms 的信息。

4

1 回答 1

1

我想我知道问题所在:请查看解释配置的文档:

http://www.onehippo.org/library/concepts/hst-configuration-model/containers-configuration.html

本文档页面解释了如何自定义容器呈现的 HTML: http ://www.onehippo.org/library/concepts/template-composer/how-to-prevent-additional-html-elements-for-containers.html

我看到的问题:

  • 您的模板中缺少hst:include。比如例如:

    <hst:include ref="mycontainer" />

  • 您已经在 hst:catalog 中创建了hst : containeritemcomponent但要成为可编辑容器,还必须在hst:workspace中创建。

  • 在您的 HST 配置中,您还必须配置对工作区中的容器的引用。比如这个例子: 示例配置

目录是组件的调色板。您在工具栏中看到的组件只能拖放到具有容器来处理这些组件的模板上。xtype定义将处理您拖放的组件(表、等)的容器类型。所以你可以做一些事情,比如堆叠。

您不能将一个容器动态地包含到另一个容器中。

于 2015-06-24T13:21:51.590 回答