I am new to Drupal. I am styling a theme, but have noticed there are some classes affecting a module's layout.

When I examine the module's .tpl.php file I find:

<div class="<?php print $classes ?>">

Which is where the classes I want to alter are appearing.

I tried looking for where this is set by editing the page, clicking on the little gear icon for that module and having a look at the CSS properties option, but this was empty.

I then looked at the module's settings themselves, but there are no options there to set styles.

Would anyone know where this $classes variable is set?

  • They are set in the _preprocess() function for the theme hook. – Jaypan Jan 3 '17 at 0:36
  • @Jaypan thanks! Sorry to bother you, but would you know where I might find that? – MeltingDog Jan 3 '17 at 0:54
  • Probably in the .module file @MeltingDog, but if there are include or requires at the top, or another file specified in hook_theme, it might be different – Clive Jan 3 '17 at 1:02
  • What is the template file name? – Jaypan Jan 3 '17 at 1:19
  • 1
    Try doing a search for ['classes_array'][] = and that might give you some insight where the classes are being set. – Danny Englander Jan 3 '17 at 17:02

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.