0

Am using the drupal 7 panels everywhere module and i have set up a panel page template for my homepage. Problem is I need to add a class to a wrapping div in the template that is dependant on the node type inside the panel pane which is inside the wrapper. This needs to be added dynamically as our site editors will be moving panel panes around a lot.

i.e. a row from my template looks like this:

   <div class="content_wrapper">
        <div id="main-content-row1" class="content">
            <?php print render($content['content-row1']); ?>
        </div>
    </div>

And I want to dynamically add a class on the 'content_wrapper' div dependant on the node type inside $content['content-row1'].

rickf
  • 3
  • 2

1 Answers1

0

Find the tpl.php file that prints that panel layout from the panels module (it can be found under "panels/plugins/layouts/YOUR_LAYOUT" folder) and copy it in your theme folder.

In the tpl.php file add the php code the same way you edit drupal themes.

TheodorosPloumis
  • 2,396
  • 1
  • 17
  • 31
  • Hi, thanks for answering.I have the tpl file that prints the layout in the theme which is where I have setup the above markup. I just need to know how to add a class to the .content_wrapper div that is dynamically set dependant on the node type which is currently inside $content['content-row1'] (panel pane). – rickf Aug 08 '13 at 21:58
  • Debug this variable using [Devel](http://drupal.org/project/devel) module and check if and how it gets the $node variable. Add a _dpm($content['content-row1']);_ inside this tpl.php file to find out. – TheodorosPloumis Aug 09 '13 at 15:18
  • Thanks for your help, I was able to get what I needed with the help devel module. – rickf Aug 13 '13 at 04:11