1

I am using the Gratis theme, but there is a little problem.

Here is the screen shot of the block region demonstration:

Gratis Theme

Yellow are the regions. I want to make the 1,2,3 marked area into one top nav where I have logo, main menu and other links. How to do that?

The main menu (third party system) is a different area. Say 4th area. Not concerned with that.

Here is the page.tpl code for these top 3 areas

`

  <!-- top links-->
  <?php if ($page['top_links']): ?>
    <div id="top-bar" class="">
      <div class="l-top-wrapper l-setwidth" <?php if (!empty($set_width)) : print 'style="max-width:' . $set_width . ';"' ; endif; ?>>
        <div class="top-links s-grid">
          <?php print render($page['top_links']); ?>
        </div>
      </div>
    </div>
  <?php endif; ?>
  <!-- //top links-->

  <!-- header -->
  <div id="header-bar" class="l-header-wrapper" role="banner">
    <header class="l-header l-setwidth" <?php if (!empty($set_width)) : print 'style="max-width:' . $set_width . ';"' ; endif; ?>>

      <?php if ($logo): ?>
      <div class="l-logo">
          <a href="<?php print $front_page; ?>" title="<?php print $site_name; ?> » <?php print $site_slogan; ?>">
            <img id="logo-img" src="<?php print $logo; ?>" alt="<?php print $site_name; ?> » <?php print $site_slogan; ?>"/></a>
        </div><!--// l-logo-->
        <?php endif; ?>

      <?php if ($site_slogan || $site_name) : ?>
      <div class="l-branding">

            <?php if ($site_name) : ?>
              <h1 class="site-name">
                <a href="<?php print $front_page; ?>">
                  <?php print $site_name; ?></a>
              </h1>
          <?php endif; ?>

              <?php if ($site_slogan) : ?>
                <h3 class="site-slogan"><?php print $site_slogan; ?></h3>
            <?php endif; ?>

      </div><!--//branding-->
        <?php endif; ?>

    </header>
  </div><!-- // l-header -wrapper-->

  <div id="menu-wrapper" class="l-menu-wrapper main-menu" role="navigation">
    <div class="l-setwidth" <?php if (!empty($set_width)) : print 'style="max-width:' . $set_width . ';"' ; endif; ?>>

      <?php if ($main_menu): ?>
        <a id="off-canvas-left-show" href="#off-canvas" class="l-off-canvas-show l-off-canvas-show--left"><?php print t('Show Navigation'); ?></a>
        <div id="off-canvas-left" class="l-off-canvas l-off-canvas--left">
          <a id="off-canvas-left-hide" href="#" class="l-off-canvas-hide l-off-canvas-hide--left"><?php print t('Hide Navigation'); ?></a>

          <div class="main-menu-wrapper">

            <?php print render($primary_nav); ?>
          </div>
        </div><!-- // off-canvas-left -->
      <?php endif; ?>`
1

I installed the theme on my computer and those elements are not printed using regions (as you said), are printed using the template file (and that's because there are no blocks with them, they are printed directly in the template file - except the menu that is printed using $primary_nav variable).

So, if you want something like you said, you need to add that content in blocks. Or, if you only want to add them in the same area or div in the page, just move them in the template file (for example, move "#menu-wrapper" in the "#header-bar" div, and you will have them together).

4
  • No body answered my question. So I did it myself. Can you explain your answer in more detail with the code? May be you have a better approach. – Umair Nov 8 '16 at 9:56
  • I am not a developer, so I did it with trial and error method, but I guess it is not a good way. – Umair Nov 8 '16 at 9:59
  • So, you can move that menu part to be in the header div in the template file... and you will have all those 3 things in one div. Is this clear enough or do you have any questions? – OPTASY Nov 8 '16 at 15:51
  • I want to see how you will do it. I mean if you dont mind can you paste the customized code here? – Umair Nov 8 '16 at 17:31

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.