Hi guys!

Running into a small snag and wondering if you both might help clarify. I want to add a navbar region to basic so I can put the navigation(primary links) into. Is this possible? In the blocks section, there is only the header section to put those links into. I know you can add the region in the .info file, which I have done. region[navbar] = navigation. How should I call it in the page.tpl.php file? I basically want the primary links to be laid out as a horizontal nav bar. Do you both recommend another way to do this?

thanks in advance!

Lance

Comments

Sorry! To clarify, I have the div layout on the front end to be as such(just a minor edit to the basic theme -adding the sub-header):

Header
Sub-Header
Navigation
Content
Sidebar
Footer

In the blocks region, at this point, the only logical option is to put them into the header region. or am I completely misunderstanding how to add primary links...

By the way, love the theme. Very easy to get in an edit!
thanks!

Thought I fixed it but didn't take.

You're about half-way there :)

You can output the "navbar" region that you just created in page.tpl.php by calling it with PHP.

<?php echo $navbar; ?>

This will output the block region in whatever location you put it in.

thanks for your help SteveK! So I wouldn't really need the php condition that's in there now? Specifically, the php if(!empty...) navigation code.

<?php
if (!empty($primary_links) or !empty($secondary_links)):
?>

<?php
if (!empty($primary_links)){ print theme('links', $primary_links, array('id' => 'primary', 'class' => 'links main-menu')); }
?>

<?php
if (!empty($secondary_links)){ print theme('links', $secondary_links, array('id' => 'secondary', 'class' => 'links sub-menu')); }
?>

<?php
endif;
?>

Thanks!!!! Sorry! Still a newb at PHP

Alright. This seems to be what I'm looking for. I basically put that php variable inside the #div navigation tag. Thank you!!!!!

$primary_links and $secondary_links output the associated menus.

$navbar outputs the block region.

The data outputted from these variables are very different. The code for outputting a block region is simply this:

<?php if($navbar): ?>
  <div id="navigation-region">
    <?php echo $navbar; ?> <!-- This is the important part! -->
  </div>
<?php endif; ?>

This includes the conditional statements as well (as requested). Let me know if this works for you.

This worked. Thank you! I know this issue was a little off topic but thank you so much for your time!!! I've been working with WP and while that is nice. I've been continuing to lean towards Drupal and the community here is awesome!!! Cannot say enough! This will make my project for my client go faster. Oh, and while I like Zen, Basic was exactly what I have been looking for. Thanks all!

Status:Active» Closed (fixed)

no problem, glad it worked :)

this helped me too, thanks guys!