1

How to add html to wrap custom panels layout programaticly? I know that i can change html in *.tpl.php but i want to avoid it. Also i want to know, how to add class to panals programaticly too.

UPD: I create custom panels layout and want to add html with custom class to wrapp regions of custom panel layout. I found good decision to use module Semantic panels, but it add markup to field, not to whole region.

This is part of my html

 <?php if ($content['left'] || $content['middle'] || $content['middle_two'] || $content['right']): ?>
    <div class="row"> 
         <div class="col-xs-12 col-md-3 col-lg-3">
            <?php print $content['left']; ?>
         </div>
    </div>
  <?php endif ?>

I want to make it like that

 <?php if ($content['left'] || $content['middle'] || $content['middle_two'] || $content['right']): ?>
    <div class="row">
         <div class="col-xs-12 col-md-3 col-lg-3">
           <article class="$custom_class">
            <?php print $content['left']; ?>
           </article>
         </div>

    </div>
  <?php endif ?>

UPD2: I try to add variable through themenaame_preprocess_panels_pane, but it doesn't appear in .tpl.php file.

Code

function dmits_preprocess_panels_pane(&$vars){

$vars['custom_article_class'] = 'seriveces-wrapp'; kpr($vars);

}

6
  • Refer to these links. Link1, Link2 & Link3
    – Nishant
    Commented May 27, 2015 at 8:58
  • Thanks, but i visited this links before
    – Vlk
    Commented May 27, 2015 at 9:01
  • Means you have already visited these links. Then please describe more your question.
    – Nishant
    Commented May 27, 2015 at 9:04
  • Ok. So what issue you are facing. I think you have put your class inside $custom_class.
    – Nishant
    Commented May 27, 2015 at 9:17
  • I had different content type, and want to add different classes to each content type. So classes name depend on content type.
    – Vlk
    Commented May 27, 2015 at 9:24

1 Answer 1

-2

The module suggested (in a comment) by Danny Englander helps me (thank you!).

I.e. module drupal.org/project/panels_extra_styles

Since Dany only posted it as a comment, I'm adding it as a "real" answer (so that I will also be abe to "mark it as accepted".

2
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post.
    – Shawn Conn
    Commented May 28, 2015 at 6:41
  • It's helpfull for me
    – Vlk
    Commented May 28, 2015 at 6:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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