php - twig: appending to parent template region from multiple includes -
general.tpl:
<head> <!-- default meta tags --> </head> <body> {% block mainarea %}{% endblock %} {% block sidebar %}{% endblock %} <!-- standard footer --> <script src="base.js"></script> {% block js %}{% endblock %} </body>
page1.tpl:
{% extends "base.tpl" %} {% block mainarea %} content {% endblock %} {% block sidebar %} ... {% include 'one-of-many-widgets.tpl' %} ... {% endblock %}
one-of-many-widgets.tpl
requires specific javascript library must referenced before
<body>
tag , needs emit specific in-line javascript before library after referencingbase.js
requres specific meta tags added page
head
block- requires append additional legal information page footer
q1: how putting additional script , meta info into one-of-many-widgets.tpl
file? given there several included widgets contribute scripts area of page.
q2: there page2.tpl, need it's own additional js , extended meta tags, in addition emitted includes. possible combine them not overwrite?
one-of-many-widgets-1.tpl:
{% block jsprebodyadditions %} {{ alreadycollected() }} widget script tag or inline js append {% endblock %} {% block metatags %} {{ alreadycollected() }} widget additional semantic meta tags append {% endblock %}
one-of-many-widgets-2.tpl:
{% block jsprebodyadditions %} {{ alreadycollected() }} widget script tag or inline js append {% endblock %} {% block metatags %} {{ alreadycollected() }} widget additional semantic meta tags append {% endblock %}
page2.tpl:
{% block jsprebodyadditions %} {{ alreadycollected() }} page2 script tag or inline js append {% endblock %} {% block metatags %} {{ alreadycollected() }} page2 additional semantic meta tags append {% endblock %}
Comments
Post a Comment