Jump to content

How to change title, description and keywords meta tags of prestashop's page without BO


Recommended Posts

Hello everyone
I want to know how is possible to change the title, description and keywords of a prestashop's page
With css and js files is possible to do this solution (adding these lines in the php file that manages this page)

$js_files = array(__PS_BASE_URI__.'js/jquery/thickbox-modified.js',);
$css_files = array(__PS_BASE_URI__.'css/thickbox.css' => 'all');


but with title, description and keywords I don't know

       <title>{$meta_title|escape:'htmlall':'UTF-8'}</title>
{if isset($meta_description) AND $meta_description}
       <meta name="description" content="{$meta_description|escape:html:'UTF-8'}" />
{/if}
{if isset($meta_keywords) AND $meta_keywords}
       <meta name="keywords" content="{$meta_keywords|escape:html:'UTF-8'}" />
{/if}
       <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
       <meta name="generator" content="PrestaShop" />
       <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/x-icon" href="{$img_ps_dir}favicon.ico" />
{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};
           var roundMode = {$roundMode};
       [removed]
       [removed][removed]
       [removed][removed]
       [removed][removed]
{if isset($js_files)}
   {foreach from=$js_files item=js_uri}
   [removed][removed]
   {/foreach}
{/if}



In header.tpl is possible to see $meta_title , $meta_description , $meta_keywords but which file manages these variables????

Thanks

Link to comment
Share on other sites

It' s possible to do like in AminProducts.php for the seo

>
</pre>
<table>'.$this->l('Meta title:').'';
       foreach ($this->_languages as $language)
           echo '                    
                                           <input size="55" type="text" id="meta_title_'.$language['id_lang'].'" name="meta_title_'.$language['id_lang'].'"
                                           value="'.htmlentities($this->getFieldValue($obj, 'meta_title', $language['id_lang']), ENT_COMPAT, 'UTF-8').'" />
'.$this->l('Forbidden characters:').' <>;=#{} 
';
       echo '                        
'.$this->l('Product page title; leave blank to use product name').'
'.$this->l('Meta description:').'';
       foreach ($this->_languages as $language)
           echo '                    
                                           <input size="55" type="text" id="meta_description_'.$language['id_lang'].'" name="meta_description_'.$language['id_lang'].'"
                                           value="'.htmlentities($this->getFieldValue($obj, 'meta_description', $language['id_lang']), ENT_COMPAT, 'UTF-8').'" />
'.$this->l('Forbidden characters:').' <>;=#{} 
';
       echo '                        
'.$this->l('A single sentence for HTML header').'
'.$this->l('Meta keywords:').'';
       foreach ($this->_languages as $language)
           echo '                    
                                           <input size="55" type="text" id="meta_keywords_'.$language['id_lang'].'" name="meta_keywords_'.$language['id_lang'].'"
                                           value="'.htmlentities($this->getFieldValue($obj, 'meta_keywords', $language['id_lang']), ENT_COMPAT, 'UTF-8').'" />
'.$this->l('Forbidden characters:').' <>;=#{} 
';
       echo '                        
'.$this->l('Keywords for HTML header, separated by a comma').'
'.$this->l('Friendly URL:').'';
       foreach ($this->_languages as $language)
           echo '                    
                                           <input size="55" type="text" id="link_rewrite_'.$language['id_lang'].'" name="link_rewrite_'.$language['id_lang'].'"
                                           value="'.htmlentities($this->getFieldValue($obj, 'link_rewrite', $language['id_lang']), ENT_COMPAT, 'UTF-8').'" onchange="updateFriendlyURL();" /> *
'.$this->l('Only letters and the "less" character are allowed').' 
';
       echo '                        
'.$this->l('Product link will look like this:').' '.(Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').$_SERVER['SERVER_NAME'].'/id_product-.html
</table>


I made a free module and I want to add the possibility to choose the meta tags of a php page
From where header.php loads the meta tags variables???

Nobody can help me???

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...
  • 1 year later...

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...