Jump to content

[Solved] How to add my Meta Tags to the header / top of my page?


Recommended Posts

Hi there,

As the title suggests, I wish to know how to add some of my Meta Tags to the header / top of my page?

Please see the attached image of what I am trying to do...

I have seen a solution where you edit header.tpl and edit the global.css. I have gotten as far where I get my text in the top of my page no problem, but I can't center it, modify the text size or change the width of the bar.


I have seen time and again where it really help a sites search engine rankings to have this at the top of your page.

Thanks

37018_ZKdfnbTVUtAAvvzAgrtb_t

Link to comment
Share on other sites

Add the following after the <body> tag in header.tpl:


{$meta_keywords|replace:', ':' | '|escape:html:'UTF-8'}



This will take the metatags like "shop, prestashop" and convert them to "shop | prestashop" and centre them at the top of the page.

Link to comment
Share on other sites

>
<html >
   <head>
       <title>{$meta_title|escape:'htmlall':'UTF-8'}</title>
{if isset($meta_description) AND $meta_description}
       <meta name="description" content="{$meta_description|escape:htmlall:'UTF-8'}" />
{/if}
{if isset($meta_keywords) AND $meta_keywords}
       <meta name="keywords" content="{$meta_keywords|escape:htmlall:'UTF-8'}" />
{/if}
       <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
       <meta name="generator" content="Shop" />
       <meta name="robots" content="{if isset($nobots)}no{/if}index,follow" />
       <link rel="icon" type="image/vnd.microsoft.icon" href="{$img_ps_dir}favicon.ico" />
       <link rel="shortcut icon" type="image/gif" href="{$img_ps_dir}pba.gif" />
{if isset($css_files)}
   {foreach from=$css_files key=css_uri item=media}
   <link href="{$css_uri}" rel="stylesheet" type="text/css" media="{$media}" />
   {/foreach}
{/if}
       [removed][removed]
       [removed]
           var baseDir = '{$content_dir}';
           var static_token = '{$static_token}';
           var token = '{$token}';
           var priceDisplayPrecision = {$priceDisplayPrecision*$currency->decimals};
       [removed]
       [removed][removed]
       [removed][removed]
       [removed][removed]
{if isset($js_files)}
   {foreach from=$js_files item=js_uri}
   [removed][removed]
   {/foreach}
{/if}
       {$HOOK_HEADER}
   </head>

   <body {if $page_name}id="{$page_name|escape:'htmlall':'UTF-8'}"{/if}>
   {if !$content_only}
</pre>
<ul>{l s='This shop requires JavaScript to run correctly. Please activate JavaScript in your browser.'}</ul>
<br><div>

           <!-- Header -->


{l s='Toys | Kids | Fun | School'}


                   {$HOOK_TOP}



           <!-- Left -->

               {$HOOK_LEFT_COLUMN}


           <!-- Center -->

   {/if}
<
Link to comment
Share on other sites

Woot! Solved!!!

Thanks Rocky! Your solution is perfect for some, but I personally did not want my complete meta tag list visible. I rather wanted to only display certain words from my meta tag list.

My solution (with your help ;)) is as follows...

You need to put the following under "<!-- Header -->" in your "Header.tpl" file...


<!-- Header -->

 ADD THIS LINE      
{l s='Toys | Kids Toys | Fun | Back to School | Kids Clothes | Bags'} 


                   {$HOOK_TOP}



The cool thing is that you only need to do this. No editing of CSS or anything.

Thanks again!

Regards,

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...