general.tpl:
$_SESSION['name']
page1.tpl:
<head>
<!-- some default meta tags -->
</head>
<body>
{% block mainArea %}{% endblock %}
{% block sidebar %}{% endblock %}
<!-- standard footer -->
<script src="base.js"></script>
{% block js %}{% endblock %}
</body>
一对多的- - widgets.tpl
需要在{% extends "base.tpl" %}
{% block mainArea %}
some content
{% endblock %}
{% block sidebar %}
...
{% include 'one-of-many-widgets.tpl' %}
...
{% endblock %}
代码之前必须引用的特定javascript库,并且需要在该库之前发出特定的内联javascript,但在引用<body>
后
要求将特定元标记添加到页面base.js
块
Q1:如何将其他脚本和元信息添加到head
文件中?鉴于有几个包含的小部件都有助于页面的脚本区域。
Q2:还有page2.tpl,除了由includes发出之外,还需要它自己的附加js和扩展元标记。是否可以组合它们但不能覆盖?
之一的许多小部件-1.tpl:
one-of-many-widgets.tpl
之一的许多小部件-2.tpl:
{% block jsPreBodyAdditions %}
{{ alreadyCollected() }} widget script tag or inline js to APPEND
{% endblock %}
{% block metaTags %}
{{ alreadyCollected() }} widget additional semantic meta tags to APPEND
{% endblock %}
page2.tpl:
{% block jsPreBodyAdditions %}
{{ alreadyCollected() }} widget script tag or inline js to APPEND
{% endblock %}
{% block metaTags %}
{{ alreadyCollected() }} widget additional semantic meta tags to APPEND
{% endblock %}