0

I have a custom content type "Community" and a page from this content type is selected as front page on the drupal 7 site (from system/siteinformation). i am using Metatag module. All other pages are showing the metatags but the front page does not.

I've also tried by overriding the metatags in admin/config/search/metatags/config/global:frontpage/edit, but still not showing up.

1

If your are using page--front.tpl.php add the below line and clear the cache.

<?php print render($page['content']['metatags']); ?>

Meta tag will be added to the front page.

0

There is a know issue for the metatag not displaying on the front page. If you read the README.txt in the module file. Between line 281 and 292 you can find following description.

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:
    <?php render($page['content']); ?>
  or
    <?php render($page['content']['metatags']); ?>
  Without one of these being present the meta tags will not be displayed.
* An alternative method to fixing the missing-tags problem is to change the page
  region used to output the meta tags. The region used may be controlled from
  the settings page, it is recommended to test different options to identify the
  one that works best for a specific site. 

If this is the case, you can look at this issue it you are using customized template.

That issue has already been registered at the Metatag module's Issue section, SOLUTION: Metatags in front not working

Additional: If you wan to Add using Views

You can get additional setting for the Frontpage. Go to admin/structures/views -> There you can find one view name frontpage, which is not enabled by default. You can enable that view. That view is a front-page for your Drupal site.

It has been provided by views as default to open up new setting for front page. Now you can add, modify whatever field you want. I hope this way you are able to access that.

enter image description here

  • thaks... but you are suggesting to create a whole new page into a view and then set this view as a front page? if so then i would not like to do this due to some reasons. please suggest some other way. thankyou – Esar-ul-haq Qasmi Aug 5 '16 at 7:50
  • Are you using page--front.tpl.php for front page. Or I mean custom template? – CodeNext Aug 5 '16 at 8:04
  • i am using page--community.tpl.php to theme the custom content. And then; from system/siteinfo i am setting page from this custom content type(community) as front page. – Esar-ul-haq Qasmi Aug 5 '16 at 8:13
  • Please see the addition section in the answer. – CodeNext Aug 5 '16 at 8:14
  • You can see on the Issue page, different solution worked for different people as per their set-up of theme and templates. You can find which one suits to your requirement. – CodeNext Aug 5 '16 at 8:23

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.