Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
First of all, great theme framework! I love the simple basic ( ;-) ) setup.
I made a little modification to the tab function. It adds a class to the primary tabs if there is a secondary tab list. I needed it in my case to do some different styling to the primary tabs. Not exactly rocket science, but a worthy addition (imho).
Instead of:
function basic_menu_local_tasks() {
$output = '';
if ($primary = menu_primary_local_tasks()) {
$output .= "<ul class=\"tabs primary clear-block\">\n". $primary ."</ul>\n";
}
if ($secondary = menu_secondary_local_tasks()) {
$output .= "<ul class=\"tabs secondary clear-block\">\n". $secondary ."</ul>\n";
}
return $output;
}
Do this:
function basic_menu_local_tasks() {
$output = '';
if ($primary = menu_primary_local_tasks()) {
if(menu_secondary_local_tasks()) {
$output .= "<ul class=\"tabs primary primary-with-secondary clear-block\">\n". $primary ."</ul>\n";
}
else {
$output .= "<ul class=\"tabs primary clear-block\">\n". $primary ."</ul>\n";
}
}
if ($secondary = menu_secondary_local_tasks()) {
$output .= "<ul class=\"tabs secondary clear-block\">\n". $secondary ."</ul>\n";
}
return $output;
}
Comments
Comment #1
Kiphaas7 CreditAttribution: Kiphaas7 commentedArgh, a more semantic class name would obviously be "with-secondary" instead of "primary-with-secondary". We already know it's primary :).
Modified function again:
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #4
Oleksa-1 CreditAttribution: Oleksa-1 commentedNot good idea.
I had to remove this function from template.php. Cause I had problems with tabs using Panels module ( tabs "Edit panel" , "view" were not visible)
Comment #5
Kiphaas7 CreditAttribution: Kiphaas7 commentedCSS class collision? Do you also get this with the original function? If not, what part of the modified function makes it break down?
Comment #6
Oleksa-1 CreditAttribution: Oleksa-1 commented@Kiphaas7
If you make custom page using Panels do you have these tabs edit and view in basic theme?
(I mean the ones in attached picture)
Comment #7
kundu CreditAttribution: kundu commentedSame prob here as @Oleksa.
and the answer to @Oleksa is yes.
Comment #8
chrislabeard CreditAttribution: chrislabeard commentedin my page.tpl.php I just added
<?php if (!empty($tabs)): ?><div id="tabs-wrapper" class="tabs-wrapper <?php if ($secondary = menu_secondary_local_tasks()): ?>secondary<?php endif; ?>"><?php print $tabs; ?></div><?php endif; ?>
not pretty but hey whatever.
Comment #9
Oleksa-1 CreditAttribution: Oleksa-1 commentedComment #10
kle CreditAttribution: kle commented@Oleska: yes, this solution was exactly the same I found out a while ago.
@SteveK: Hello maintainer ! I like this theme a lot, used it in many sites and wondered since a long time about the lack of the Edit Panel Button.
** Please ** put this piece of code in the template.php
Greetings from Hamburg !
Comment #11
damiankloip CreditAttribution: damiankloip commentedHi kle, I'm not sure this should be in the basic theme as it isn't really a fundamental. It is only applying to panels users, which isn't everyone I'm afraid :)
Comment #12
damiankloip CreditAttribution: damiankloip commented