1

I'm customizing a theme and need to have a leaderboard on top of the page. Everything good - on all pages but not the home (front-page)... Any ideas what I did wrong?

I've added a region to the .info file

regions[topad] = Leaderboard header

and printed that region to the page.tpl.php like that:

 <?php if ($page ['topad']): ?>
   <div id="topad">
        <?php print render($page['topad']); ?>
   </div> <!-- /#topad -->
 <?php endif; ?>

I added a block with the leaderboard infos to the region and told it to show up on every page (also tried specific pages with "" - didn't work).

I'm happy for every hint.

Thank you!

Best

Chris

  • 1
    Try removing the space in your if statement. $page['topad'] instead of $page ['topad']. – kyletaylored Feb 6 '14 at 23:14
  • Thank you. I did that but it did not solve the problem. – Chris Klein Feb 7 '14 at 7:48
  • Is you page.tpl.php actually labeled page-tpl.php using a hyphen instead of a period? Just for posterity, you might want to update the typos in your question as well, because those little things do make a difference. – kyletaylored Feb 7 '14 at 8:05
  • You're right. Sorry for that. It's the page.tpl.php - I've edited it. – Chris Klein Feb 7 '14 at 8:16
  • Have you tried making just a static block with a title and text and putting it on all pages, testing it in one region and another to see if it shows up everywhere else? – kyletaylored Feb 7 '14 at 8:30
0

Do you have a specific template for your front page? Is your front page pointing at a node? Or just a list of recent updates?

|improve this answer|||||
  • No specific template. Home is a basic page with name "home", set as front page within config/system/site information. – Chris Klein Feb 7 '14 at 7:30
  • are you willing/able to install the Devel and "Theme Developer" modules? drupal.org/project/devel_themer You can use it to see exactly which template is being used. I'm convinced that your front page is not using the standard page template. also, are you sure you've got your block set up in terms of "Show block on specific pages" ? – jdu Feb 7 '14 at 14:02
  • Hi JDU, that solved the problem! The front-page had a specific template within a strangely labelled subfolder. Inserting the code there solved the problem. Thank you! – Chris Klein Feb 7 '14 at 18:24

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.