1

I see that this:

<body>
  <div id="content-area">
    <?php print $content; ?>
  </div>
  <?php print $page_closure; ?>
  <?php print $closure; ?>
</body>

Will actually render all the content of a page. So all those other variables are only for regions. But, remove that one variable, $content and no matter how much else PHP one has in the template, nothing gets rendered.

I'm trying to specifically call the primary and secondary links in certain areas of a page.tpl.php template.

My attempts moving around a code block within the standard page.tpl.php file haven't worked; wherever I put the secondary, they always appear below the primary.

For instance, this:

<?php 
   print theme(array('links__system_main_menu', 'links'), $primary_links,
   array(
      'id' => 'main-menu',
      'class' => 'links clearfix',
       ));
?>

Doesn't matter if it's after the secondary in source order... it always appear on top of my secondary links. Even if I put it below the $footer variable. So how can I get those links to be called in a different area of the page.tpl.php template?

I have no blocks in any region. I realize I can just use CSS to reposition the menus, but that doesn't seem right to move them across/down a page that kind of distance.

What is snippet/way to pull out specific content from the $content variable, specifically the primary and secondary links and place them within the page.tpl.php template where I would like them?

  • Given that you are commenting out the printing of the variable $content_top yet asking about the $content variable I am not really sure what your question is... – Jimajamma Aug 15 '13 at 22:41
  • Sorry, I was trying to show that I've experimented and done more than just post. See the 2nd example where I took out all but the $content variable. My question is how do I set the actual document flow order of the information contained within $content? Since the ONE variable of $content prints EVERYTHING, I'd like to know how I re-order the $primary_links to appear anywhere within that variable instead of where it does by default. – kelly johnson Aug 15 '13 at 23:57

Your Answer

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

Browse other questions tagged or ask your own question.