1

I am using Drupal 8 Panels and it is working fine. The problem currently I have is, that I want to add classes to individual blocks on the panel layout page. Is there a way to add classes to blocks on panel pages?something like the Drupal 7 version of CSS properties on panel panes?

  • No, this feature isn't supported yet. Create a feature request in the issue, this isn't an question that can be answered here. – Berdir Feb 29 '16 at 10:14
  • 1
    I have a module that does this, basically you have to alter the block settings form and attach the classes in theme preprocessor.(I don't use panels) – user21641 Mar 1 '16 at 9:43
  • 1
    For blocks you have block_class module, drupal.org/project/block_class For page manager theres is a feature request drupal.org/node/2710169 – alzz Apr 21 '16 at 8:48
  • A possible better solution is being worked on for panels: drupal.org/node/2296437 – dobrzyns Oct 5 '16 at 15:16
0

For custom blocks it's pretty easy to add classes without any module. Simply add a text (plain) field - or whatever fit's your needs best, get the value in the block.html.twig (maybe use Twigs |clean_class filter) and add it to the classes.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.