Hi there, can someone tell me how I can add meta tags (I only need the description tag) to drupal's front page?

I would like to do this without adding the tag to all the pages.

Comments

vm’s picture

page.tpl.php in your theme is called for every page in drupal and is where the head tag is located

_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )

hinchcliffe’s picture

Thanks,

If I change that up it will affect all my other pages, and that's not what I want. (Bad for SEO.)

I guess I could write a php IF statement saying If > homepage echo - meta description.

Would anyone be kind enough to write me this?

vm’s picture

In that case use a custom page-front.tpl.php that gets called on front page alone.

more on this method in the theme section of the documentation area.

_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )

davedelong’s picture

frontpage.tpl.php

hinchcliffe’s picture

thanks dave / missunderstood!

Aleksic’s picture

For Drupa 6. If somone need can use this for two languages. Copy your page.tpl.php and make your page-front.tpl.php in this file after head insert this code.
xy is your secend language on site

<?php
global $language;
 if (drupal_is_front_page() && $language->language == "xy") {
 echo '<meta name="keywords" content="enter keywords for your secend language" />
<meta name="description" content="enter description for your secend language" />'; } else {
 echo '<meta name="keywords" content="keyword for default language" />
<meta name="description" content="description for default language" />';}
?>
exterm’s picture

I am trying the same.. but how do i do on drupal 7x version
pls help