0

I have my social media links in my sidebar_first region. And these social icons are included in my footer. So in region--footer.tpl.php, I have rendered sidebar_first region but it is not displaying, I know this is a wrong way to render a side bar region in footer region, does anybody have idea how can I achieve this:

<?php if ($content): ?>
<footer id="footer" class="<?php print $classes; ?>">
  <nav class="footer-nav">
    <?php $foter_menu = menu_navigation_links('menu-footer-menu');
      $variables['footer_menu'] = print theme('links__menu_footer_menu', array('links' =>      $foter_menu,'attributes'=>array(''),'heading'=>t('')));
      ?>
  </nav>
  <div class="left-panel">
    <ul class="social-networks">
      <?php print render($page['sidebar_first']); ?>
    </ul>
  </div>
</footer>
<?php endif; ?>

then in my page--front.tpl.php

 <?php print render($page['footer']); ?>
  • It's not quite clear what are you trying to do. Do you want to use a same block twice? If not, explain the issue in a bit more details please. – Aram Boyajyan May 22 '15 at 7:46
0

as you wrote, you can override the region.tpl.php files, following the template name conventions - I would post a link, but drupal.org is down right now. A quick web search should get you to the right url and you can create a region specific tpl file.

you shouldn't try to render one region in another, but you can duplicate the code in both region files, or of course, you could also include the code in two blocks, one for each region

0

I suspect, though am not sure, that the render sidebar_first in the footer is not rendering because it has already been rendered. In D7, try putting a call to:

"unhide($page['sidebar_first'])" 

immediately before the footer call to render()

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.