1

I have defined many regions in my theme template. I would like to have a home page that uses these regions ... how can i use them? I have made a home.tpl.php but i don't know how to assign code to regions ... is it possible to do it even outside the page.tpl.php?

1

If you define a region you would normally then do the following in your page.tpl.php file...

<?php if ($YOUR_REGION): ?>
    <?php print $YOUR_REGION; ?>
<?php endif; ?>

You should have some similar examples setup already especially if you are using a theme that ships with Drupal.

You can create specific page templates...

function YOURTHEME_preprocess_page(&$variables) {
  if (arg(0) == 'my_page') {
    $variables['template_file'] = 'page-my_page';
  }
}

Template suggestions

See: http://drupal.org/node/1089642

Context module

Also, the Context module is brilliant for this sort of thing if you intend on having different regions for different pages you can use Context layout.

http://drupal.org/project/context

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.