Skip to content

[Templating] Explain the hinclude.js attributes #14074

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 31, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions templating/hinclude.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,16 @@ Or you can also specify a string to display as the default content:

{{ render_hinclude(controller('...'), {default: 'Loading...'}) }}

Use the ``attributes`` option to define the value of hinclude.js options:

.. code-block:: twig

{# by default, cross-site requests don't use credentials such as cookies, authorization
headers or TLS client certificates; set this option to 'true' to use them
{{ render_hinclude(controller('...'), {attributes: {data-with-credentials: 'true'}}) }}

{# by default, the JavaScript code included in the loaded contents is not run;
set this option to 'true' to run that JavaScript code #}
{{ render_hinclude(controller('...'), {attributes: {evaljs: 'true'}}) }}

.. _`hinclude.js`: http://mnot.github.io/hinclude/