I think that making the twig tag as synonym of theming is not suitable. There are many issues related to twig as it is, not related to the theming concepts of drupal 8.
1 Answer
I think that questions about using Twig in Drupal are different enough from general theming to warrant removing the tag synonym. Based on the Twig-related questions I have read, most were about "how can I do this Drupal thing in Twig (eg, absolute links)" and not "how do I iterate in Twig" or "how do I style this Twig output".
While Twig is most closely connected with the themes
- modules can provide Twig templates
- render arrays can contain inline templates
- Twig tokens appear in few odd places (like in Views)
Those are all output related, but I wouldn't consider them a theming task.
-
Templates and render arrays are for theming. The fact the Views module uses
{{ }}
for tokens doesn't mean it is using Twig for its tokens. And theming is not connected to themes, since also modules can define theme hooks.– avpaderno ModCommented Aug 10, 2016 at 2:43 -
1@kiamlaluno Picking nits here, Twig tokens in Views are actually implemented as inline templates and run through the renderer. I haven't really explored what works here beyond simple placeholders.– mpdonadio ModCommented Aug 10, 2016 at 16:28
-
Still, we are talking of Twig tokens that are rendered through the renderer. Is there any question where twig would be relevant, and the question is not about theming (which means, not about the renderer Drupal uses, the render array, or any template file)?– avpaderno ModCommented Aug 21, 2016 at 5:01
-
@kiamlaluno I am going to turn this around by asking, do we have theming questions that aren't about twig? According to our help center, synonyms should be used "whenever you see questions being repeatedly tagged with the wrong or incorrect tag" or "multiple tags that mean the same thing". Twig may mean theming, but theming doesn't always involve Twig. I think this is an important enough concept that was introduced in Drupal 8 that it warrants it's own distinct tag.– mpdonadio ModCommented Aug 22, 2016 at 0:26
-
It's exactly the same as with jquery and javascript. Are there questions about JavaScript that aren't about jQuery? Sure, but that doesn't mean that we need both those tags. Users started to use twig for questions about template files, not about Twig. Do we want to see 8 theming twig for all the theming questions for Drupal 8 or Drupal 9 which are about a template file, in a way or another?– avpaderno ModCommented Aug 22, 2016 at 4:22
{{ blah blah}}
in the question while theming only will not have them and it may be concentrated onfunction preprocess...
.