Hi there

I have had to use a custom frontpage, by modifying the page.tpl.php of the nexus theme to front--page.tpl.php to have such an effect such as http://bit.ly/1kNG2ob with the front page having no content area. I need to also say this a multilingual site.

This is the code for this front-tpl.php

<div id="bodyfront">
<div id="page">
  <header id="masthead" class="site-header container" role="banner">
    <div class="row">
      <div id="logo" class="site-branding col-sm-6">
        <?php if ($logo): ?><div id="site-logo"><a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>">
          <img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" />
        </a></div><?php endif; ?>
        <h1 id="site-title">
          <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>"><?php print $site_name; ?></a>
        </h1>
      </div>
      <div class="col-sm-6 mainmenu extendmenu">
        <div class="mobilenavi"></div>
        <nav id="navigation" role="navigation">
          <div id="main-menu">
            <?php 
              if (module_exists('i18n_menu')) {
                $main_menu_tree = i18n_menu_translated_tree(variable_get('menu_main_links_source', 'main-menu'));
              } else {
                $main_menu_tree = menu_tree(variable_get('menu_main_links_source', 'main-menu'));
              }
              print drupal_render($main_menu_tree);
            ?>
          </div>
        </nav>
      </div>
    </div>
  </header>
  <!-- /header -->
  <div id="front-container">
  </div>
  <!-- /middle-container -->
  <div style="clear:both"></div>
  <?php if($page['footer']) : ?>
    <div id="footer-block">
      <div class="container">
        <div class="row">
          <div class="col-sm-12">
            <?php print render($page['footer']); ?>
          </div>
        </div>
      </div>
    </div>
  <?php endif; ?>

  <?php if ($page['footer_first'] || $page['footer_second'] || $page['footer_third'] || $page['footer_fourth']): ?>
    <?php $footer_col = ( 12 / ( (bool) $page['footer_first'] + (bool) $page['footer_second'] + (bool) $page['footer_third'] + (bool) $page['footer_fourth'] ) ); ?>
    <div id="bottom">
      <div class="container">
        <div class="row">
          <?php if($page['footer_first']): ?><div class="footer-block col-sm-<?php print $footer_col; ?>">
            <?php print render ($page['footer_first']); ?>
          </div><?php endif; ?>
          <?php if($page['footer_second']): ?><div class="footer-block col-sm-<?php print $footer_col; ?>">
            <?php print render ($page['footer_second']); ?>
          </div><?php endif; ?>
          <?php if($page['footer_third']): ?><div class="footer-block col-sm-<?php print $footer_col; ?>">
            <?php print render ($page['footer_third']); ?>
          </div><?php endif; ?>
          <?php if($page['footer_fourth']): ?><div class="footer-block col-sm-<?php print $footer_col; ?>">
            <?php print render ($page['footer_fourth']); ?>
          </div><?php endif; ?>
        </div>
      </div>
    </div>
  <?php endif; ?>

  <footer id="colophon" class="site-footer" role="contentinfo">
    <div class="container">
      <div class="row">
        <div class="fcred col-sm-12">
          <?php print t('Copyright'); ?> &copy; <?php echo date("Y"); ?>, <a href="<?php print $front_page; ?>"><?php print $site_name; ?>####</a>.
        </div>
      </div>
    </div>
  </div>
</div>
<!-- /page NF VER 2.4-->

After some real fight, the sight is quite similar to the example, but I noted that the metatags are missing, with only

<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />

appearing on the FRONT page.

How do I get the rest of metatags appearing like on the rest of the pages?

I am NOT a coder & so would appreciate some specific code if necessary & where exactly to place it.

Thank you in advance.

Comments

lionheart8’s picture

Please let someone help.

I just need meta tags/content to be printed in the above case, where as said a custom front page had to be made.
May be there are other ways to have made the front--page.tpl.php, but the few responses I got in the forum, could not lead to the output similar to the sample site at above link, for example if I used the available front page modules, with which they would be no problem with the meta tags.
or if that is not possible & I was to directly & manually add them, exactly in which theme file would this be?

Any help would very much be appreciated.

Kind regards

alcroito’s picture

From the readme.txt

Troubleshooting / Known Issues
------------------------------------------------------------------------------
* When using custom page template files, e.g., page--front.tpl.php, it is
important to ensure that the following code is present in the template file:
render($page['content']);
or
render($page['content']['metatags']);

Your template doesn't contain any of the two. You should add
render($page['content']['metatags']);
to your template.

lionheart8’s picture

Hello Placinta

Thank you for taking the time to respond.

I included the last option and the meta tags are now printed as expected.

Very much appreciated!

Regards

DamienMcKenna’s picture

Status: Active » Closed (duplicate)

The current -dev release (forthcoming v1.5) has a new feature (#2460791: Allow the page region to be changed) on the Advanced Settings page where you can change the template region used to trigger the meta tags to be output, this feature should let you resolve the problem.