8

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.

5
  • In Drupal 8, Twig is just used for theming. It doesn't sense for us having twig, in the same way it doesn't make sense having jquery, since we can just have questions about using Twig in template files. Questions about, for example, finding a Twig extension to use in Drupal, would be off-topic for us.
    – avpaderno Mod
    Commented Aug 9, 2016 at 18:21
  • 1
    By this way the tag's scope will be wider and it will loss its benefit. Applying the logic you regarded, means that website should only have about 10 tags: themes, modules, vendors, 6, 7, 8, 9, .... We can not ignore that some questions, the OP ask it mainly for an issue or a requirement meant by twig itself only. @kiamlaluno
    – SaidbakR
    Commented Aug 9, 2016 at 20:00
  • 2
    Questions about Twig itself are off-topic, for us, in the same way questions about jQuery itself are off-topic. Only questions about using Twig in Drupal are on-topic; the rest of the questions are for Stack Overflow.
    – avpaderno Mod
    Commented Aug 9, 2016 at 20:13
  • 1
    I think that the Tag is just an initial flag for the question which gives a quick hint about the topics that question is meant by. From this point of view for the tag you may understand what I mean in this topic. For example, when you see twig and theming tags for aquestion, you will expect to see {{ blah blah}} in the question while theming only will not have them and it may be concentrated on function preprocess....
    – SaidbakR
    Commented Aug 9, 2016 at 20:28
  • 2
    @kiamlaluno Do you want to post your counter argument to my answer for people to comment on?
    – mpdonadio Mod
    Commented Aug 9, 2016 at 23:31

1 Answer 1

5

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.

5
  • 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 Mod
    Commented 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 Mod
    Commented 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 Mod
    Commented 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 Mod
    Commented 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 Mod
    Commented Aug 22, 2016 at 4:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .