Iam new to drupal 8 and I was wondering if one can alter the html output once before it gets injected into the twig template file. In my case I would like to remove some classes and add some tags to the search. Could anyone provide some guids or documentation on how to do such things? That would be very helpful, just found some drupal 7 things on it, but they seem to be outdated.

Thanks in advance!

  • 1
    Start with this video from mortendk youtube.com/watch?v=bvaz9eb54c4 and then you probably know what you need to type into google. – 4k4 Feb 23 '16 at 14:17
  • Generally, HTML should only be output in Twig templates, and the templates should have complete control over the classes that are output as well (see Using attributes in templates). So, you probably need to find the right template to alter the markup, which Debugging Twig templates will probably help. – gapple Feb 23 '16 at 23:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.