I want to define a plugin, which can accept child plugins at more than one location, allowing the user to state the location (much like a placeholder).
Consider the following:
plugins.py
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from cms.models.pluginmodel import CMSPlugin
from django.utils.translation import ugettext_lazy as _
class Container_Md_4_4_4(CMSPluginBase):
model = CMSPlugin
render_template = "plugins/container_md_4_4_4.html"
cache = False
allow_children = True
name = _("Container Plugin, Md, 4-4-4")
plugin_pool.register_plugin(Container_Md_4_4_4)
plugins/container_md_4_4_4.html
{% load cms_tags %}
<div class="col-md-4">
<-- WANT CHILD PLUGIN TO OPTIONALLY GO HERE -->
</div>
<div class="col-md-4">
{% for plugin in instance.child_plugin_instances %}
{% render_plugin plugin %}
{% endfor %}
</div>
<div class="col-md-4">
<-- WANT CHILD PLUGIN TO OPTIONALLY GO HERE -->
</div>
So in the above template, all the child plugins go in the center div, but I would like the user to be able to put child plugins in the left div, or the right div. The user might say, put an image plugin in the left, another container plugin (like this one above) in the center, and text plugin in the right -- this would permit complex nested layout structures to be build on the fly.
So I guess what I am looking for is the functionality of a 'placeholder' for plugins.