How to add container to another container dynamically in Hippo CMS by dragging and dropping them from catalog toolbar?

I am using Hippo CMS 10. Through the console in hst: catalog I created hst: containeritemcomponent with hst: xtype, hst: referencecomponent, hst: iconpath, hst: label.
hst: references of referenced components to hst: containercomponentfolder in hst: workspace / hst: containers / that contain hst: containercomponent with hst: xtype set to HST.Span

I want a container that can contain (dynamically) a variable number of other containers. For example, I want to be able to create this structure by dragging components from the catalog toolbar:

<!-- 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>

      

Thus, I should be able to dynamically create some page structure. Is it possible? If so, how can I achieve this? If not, how to get around it, what is the idea?
The HippoCMS site is very low for such examples and there is no information on hippos other than this site.

+3


source to share


1 answer


I think I know the problem: check out this documentation which explains the configuration:

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

This documentation page describes how to customize the HTML rendered by containers: http://www.onehippo.org/library/concepts/template-composer/how-to-prevent-additional-html-elements-for-containers.html

The problems I see:



  • you are missing hst: include in your template. For example, for example:

    <hst:include ref="mycontainer" />

  • you created hst: containeritemcomponent in hst: catalog , but containers must also be created in the hst: workspace for editing .

  • in your HST config, you should also set up a reference to the container you have in your workspace. For example this example: Sample configuration

The catalog is a palette of components. The components that you see on the toolbar can only be dragged onto a template with containers to process these components. xtype defines the type of container that will handle the components (components) that you drag & drop (table, etc.). This way you can do things like styling.

You cannot dynamically include a container in another container.

+1


source







All Articles