【发布时间】:2020-11-06 09:51:42
【问题描述】:
我是 Drupal 的新手,我正在基于 Drupal 8 上的 Bootstrap Bario 子主题创建自定义主题。 我可以毫无问题地更新 CSS,但我首先需要在重新加载页面之前清除缓存(这很烦人,有没有办法避免这种情况?)。
这是主题区域的排列方式:
我在 .info.yml 文件的footer_fifth: 'Footer Fifth' 行下添加了help: 'Help' 区域,添加的帮助区域出现在块布局页面中。
然后我修改了 templates/_page.html.twig 的相关部分,如下所示: 从此
{% block footer %}
<div class="{{ container }}">
{% if page.footer_first or page.footer_second or page.footer_third or page.footer_fourth %}
<div class="site-footer__top clearfix">
{{ page.footer_first }}
{{ page.footer_second }}
{{ page.footer_third }}
{{ page.footer_fourth }}
</div>
{% endif %}
{% if page.footer_fifth %}
<div class="site-footer__bottom">
{{ page.footer_fifth }}
</div>
{% endif %}
</div>
{% endblock %}
到这里
{% block footer %}
<div class="{{ container }}">
{% if page.footer_first or page.footer_second or page.footer_third or page.footer_fourth or page.footer_fifth %}
<div class="site-footer__top clearfix">
{{ page.footer_first }}
{{ page.footer_second }}
{{ page.footer_third }}
{{ page.footer_fourth }}
{{ page.footer_fifth }}
</div>
{% endif %}
{% if page.help %}
<div class="site-footer__bottom">
{{ page.help }}
</div>
{% endif %}
</div>
{% endblock %}
如您所见,我将or page.footer_fifth 添加到第一个if 语句,将{{ page.footer_fifth }} 移动到site-footer__top div,并在其位置添加{{ page.help }}。
之后,我去清除缓存,但块区域仍然相同。如果我在页脚第五区域检查我的块,它仍然在<div class="site-footer__bottom"> 中。
我错过了什么吗?
提前谢谢你。
【问题讨论】:
标签: symfony drupal twig drupal-8