我的网站上有一个新闻班次显示在每个页面上,因此我创建了static_placeholders来管理它的内容。但是,横幅在移动设备上具有不同的外观,这意味着我创建了2个部分,其中一个显示大屏幕新闻广告,另一个部分显示移动版本。但是,内容是相同的,所以我将static_placeholder从大屏幕部分复制到移动部分,如下所示:
<div class="section no-padding">
<div class="row hide-on-large-only hide" id="announcement-mobile" style="background: linear-gradient(to bottom, #26a69a 0%, #26a69a 50%, #ffffff 50%, #ffffff 100%); ">
<div class="col s12">
<div class="card">
<div class="card-image"><a class="btn-floating btn-flat waves-effect waves-default transparent hide-announcement" href="#!" style=""><i class="material-icons">close</i> </a>
{% static_placeholder "CTA billede" %}
<span class="card-title"><i class="material-icons">fiber_new</i> {% static_placeholder "CTA overskrift" %}</span></div>
<div class="card-content">
<p class="teal-text text-lighten-1 left-align">{% static_placeholder "CTA tekst" %}</p>
</div>
<div class="card-action">
{% static_placeholder "CTA links" %}
</div>
</div>
</div>
</div>
</div><!-- end mobile -->
<div class="section no-padding">
<div class="row hide-on-med-and-down hide" id="announcement" style="background: linear-gradient(to bottom, #26a69a 0%, #26a69a 50%, #ffffff 50%, #ffffff 100%); ">
<div class="col s12 m8 offset-m2">
<div class="card horizontal hoverable">
<div class="card-image">
{% static_placeholder "CTA billede" %}
</div>
<div class="card-stacked">
<a class="btn-floating btn-flat waves-effect waves-default transparent hide-announcement" href="#!"><i class="material-icons blue-grey-text">close</i> </a>
<div class="card-content blue-grey-text">
<span class="card-title light blue-grey-text"><i class="material-icons small">fiber_new</i>{% static_placeholder "CTA overskrift" %} </span>
<div class="divider blue-grey" style="padding-bottom: 5px; margin-bottom: 15px;"></div>
<p class="blue-grey-text left-align">{% static_placeholder "CTA tekst" %}</p>
</div>
<div class="card-action">
{% static_placeholder "CTA links" %}
</div>
</div>
</div>
</div>
</div><!-- end desktop -->
</div><!-- End CTA -->
然而,这会引发以下错误:
这导致占位符变得无法编辑。
python版本3.6.1 Django版本1.10.7 Djangocms版本3.4.4