简体   繁体   English

django cms:占位符的模板

[英]django cms: template for placeholder

Placeholder : packages_details_header 占位符:packages_details_header

  1. Banner 旗帜
  2. static block (where we add the text in textarea and convert it into html at time of render) 静态块(我们在textarea中添加文本,并在渲染时将其转换为html)
  3. two label 两个标签
  4. label for heading 标题标签

But as per the html wrappers and css classes, I think it is difficult to implement above structure 但是根据html wrapper和css类,我认为很难实现上述结构

So my suggestion is 所以我的建议是

can we have pre defined template for placeholder? 我们可以为占位符预定义模板吗?

Where all above listed plugins are predefined in placeholder template, like as shown in following example 上面列出的所有插件都是在占位符模板中预定义的,如以下示例所示

{% block content %}
    {% placeholder "packagesdetailscontent" %}
        <div class=”banner”> banner plugin </div>
        <div class=”static”> Static plugin </div>
        ..
        ..
        ..
        <h2> label plugin</h2>

    {% endplaceholder "packagesdetailscontent"  %}
{% endblock content %}`

Please let me know, if there is any solution on it 如果有任何解决办法,请告诉我

thanks, 谢谢,

B

You can limit plugins allowed in a placeholder using CMS_PLACEHOLDER_CONF 您可以使用CMS_PLACEHOLDER_CONF限制占位符中允许的插件

See http://django-cms.readthedocs.org/en/latest/reference/configuration.html#cms-placeholder-conf 参见http://django-cms.readthedocs.org/en/latest/reference/configuration.html#cms-placeholder-conf


Update: 更新:

I read your question again, if I understand it correctly.. you are struggling with wrapping plugin with html class? 如果我理解正确,我会再次阅读您的问题。.您是否正在用html类包装插件?

Have you had a look at https://github.com/divio/djangocms-style 你看过https://github.com/divio/djangocms-style

It would allow you wrap your existing plugin in whatever classes you need :-) 它可以让您将现有插件包装在所需的任何类中:-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM