Open soniktrooth opened 7 years ago
I propose
{% inklude('type','template', contextvars) %}
with optional namespace?
{% inklude('type','template', contextvars, namespace) %}
@thiagodemellobueno what is type
in your proposal?
We'd need to implement this in three different places:
--extend
to add it inUsing a macro
is another quick and dirty solution too.
The idea of using a function is that we actually do want to implement it differently in Drupal land vs. the others. This would let us set up one definition of inklude()
via PHP (for the Derps) and another in JS (for KSS and metalsmith). The former would call Drupal 8's version of D7's render()
, while the latter would simply be wrapper for Twig's include()
function (not the include statement). FYI last I checked, the include statement still wasn't ported to TwigJS.
last I checked, the include statement still wasn't ported to TwigJS
Yup, missing in TwigJS....
include
I can work on adding that.
To answer Josh's old question: Type was supposed to be "molecule, atoms, organisms" etc.... basically the minimum information we need to build paths, or summon the right namespace. I guess we can switch it to namespace.
We want to handle template inclusion for both prototype and Drupal. We have a notion of writing a custom function to include templates that can hide the ugliness.
{% inklude('template.html.twig', vars) %}
We should try and nail down a set of features or approaches here.