Skip to content

Commit e6dd26e

Browse files
committed
minor #14074 [Templating] Explain the hinclude.js attributes (javiereguiluz)
This PR was squashed before being merged into the 4.4 branch. Discussion ---------- [Templating] Explain the hinclude.js attributes Recently it took me some time to learn how to run JS code in a content loaded via hinclude.js ... so I propose to add a short explanation about these attributes. Commits ------- 8539dc5 [Templating] Explain the hinclude.js attributes
2 parents adc4630 + 8539dc5 commit e6dd26e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

templating/hinclude.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,16 @@ Or you can also specify a string to display as the default content:
8888
8989
{{ render_hinclude(controller('...'), {default: 'Loading...'}) }}
9090
91+
Use the ``attributes`` option to define the value of hinclude.js options:
92+
93+
.. code-block:: twig
94+
95+
{# by default, cross-site requests don't use credentials such as cookies, authorization
96+
headers or TLS client certificates; set this option to 'true' to use them
97+
{{ render_hinclude(controller('...'), {attributes: {data-with-credentials: 'true'}}) }}
98+
99+
{# by default, the JavaScript code included in the loaded contents is not run;
100+
set this option to 'true' to run that JavaScript code #}
101+
{{ render_hinclude(controller('...'), {attributes: {evaljs: 'true'}}) }}
102+
91103
.. _`hinclude.js`: http://mnot.github.io/hinclude/

0 commit comments

Comments
 (0)