aaron
aaron

Reputation: 120

Updating Drupal 6 theme to Drupal 7

I'm not a Drupal developer, but for a non-profit I'm trying to update a Drupal 6 theme to run in Drupal 7. (I do know WP and ExpressionEngine)

The following shows the navigation in Drupal 6, in Drupal 7 the it renders as Array.

if ($navigation)
<div class="left"></div>
<?php echo $navigation; ?>
<?php endif; ?>

It seems in 7 I'm supposed to refer to items via the $page array, but doing a print_r on $page['navigation']; results in a huge array, and I'm not sure how to use it properly. And print render($page['navigation']) doesn't render either.

Am I missing something obvious? Thanks.

Upvotes: 0

Views: 70

Answers (2)

Albert Matevosov
Albert Matevosov

Reputation: 66

What is "navigation" ???

  1. Region of theme?
  2. Name of menu?

1) If this is a region that it should workign:

  <?php print render($page['navigation']); ?>

2) If this is a menu that you should place block (named "navigation menu") into some region. And show this region in your template:

  <?php print render($page['some-region']); ?>

Upvotes: 1

joshmmo
joshmmo

Reputation: 1062

If you know the name of the menu inside drupal you can render it this way:

Example of page.tpl.php:

<div id="menu">
    <?php if (isset($secondary_menu)) { ?><?php print theme('links', $secondary_menu, array('class' => 'links', 'id' => 'subnavlist')); ?><?php } ?>
    <?php if (isset($main_menu)) { ?><?php print theme('links', $main_menu, array('class' => 'links', 'id' => 'navlist')) ?><?php } ?>
  </div>

For more information on how to convert a drupal 6 theme to drupal 7 I would recommend going through this tutorial:

https://drupal.org/node/254940#menus

Upvotes: 0

Related Questions