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

  1. requires specific javascript library must referenced before <body> tag , needs emit specific in-line javascript before library after referencing base.js

  2. requres specific meta tags added page head block

  3. 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

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -