Hi all,
I need to get the secondary links, using <?php print theme('links', $secondary_links); ?> in the template, in the left sidebar, so I have the following in my template -
<?php if ($left || $secondary_links: ?>
<div id="sidebar-left">
<?php print theme('links', $secondary_links); ?>
<?php print $left; ?>
</div>
<?php endif; ?>
But I now need <?php print $body_classes; ?> to acknowledge the left sidebar when $secondary_links exist, but there are no blocks in $left.
I realise it gets these values from the layout variable:
// Set up layout variable.
$variables['layout'] = 'none';
if (!empty($variables['left'])) {
$variables['layout'] = 'left';
}
if (!empty($variables['right'])) {
$variables['layout'] = ($variables['layout'] == 'left') ? 'both' : 'right';
}
So how do I get this variable to acknowledge the presence of secondary links?
I'm sure this is easy as, according to the api, the layout variable is available to page.tpl.php, but my (very) limited php skills can't figure out how. (I'm using the excellent ZEN theme as a base, if there's an easy route there?)
Any help would be massively appreciated
Comments
Could you just make your
Could you just make your secondary links a block in the $left region through the blocks user interface (/admin/build/block/list)? That way $left will have content -- and you won't need to worry about hardcoding the secondary_links variable in the template at all.
The secondary links are
The secondary links are sourced from the primary links, so unfortunately the Secondary Links block doesn't work. It only works properly if you use "print theme('links')"
Ok, I've got it... if
Ok, I've got it... if anyone's interested:
Yay - glad you were able to
Yay - glad you were able to figure out the override. Sorry I wasn't more help!
Awesome
This helped me a lot!
Thanks for posting it.