0


I'm trying to rewrite the output of the title of a panels page. I would like to add a class, for example. Actually, if I understand well, panels takes the layout from page.tpl.php then from the selected layout for its contents.
I tried to use taxonomy-term.tpl.php (I'm using the taxonomy page override by panels) but it doesn't work. Still, panels takes header, navbar and title styles from page.tpl.php.
Is there a way to avoid this? Is there a way to add a class or an id to the title element of a panels page?

Edit:
I found this which is for node_view panels template. I don't know if for term_view is different.

2
  • I've never been good with the frontend related parts of Panels, so I don't have a straight answer, but if you look in the issue queue, you should be able to find the issue that added the ability to override individual panes, such as content-pane-taxonomy-term (or whatever it would actually be called).
    – Letharion
    Commented Nov 30, 2013 at 14:50
  • Thanks for the comment @Letharion. Actually, my question is not related to single content panes but to the main title of the panels page. I'll check the issue queue, by the way :)
    – Kropot
    Commented Nov 30, 2013 at 14:53

1 Answer 1

0

Following the comment on the panels issue linked in the question, I managed to make the panels page override for term_view works.
This is the code added to mytheme/template.php

function MYTHEME_preprocess_page(&$vars) {
  // if this is a panel page, add template suggestions
  if($panel_page = page_manager_get_current_page()) {
    // add a generic suggestion for all panel pages
     $variables['theme_hook_suggestions'][] = 'page__panel';
    // add the panel page machine name to the template suggestions
    $variables['theme_hook_suggestions'][] = 'page__' . $panel_page['name'];
        if($panel_page['name'] == 'term_view' ) {
           $vars['theme_hook_suggestions'][] = 'page__term_view';
}
}
}

Then, inside the mytheme/templates/ folder, I added page--term_view.tpl.php with my custom page title display.

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.