fruizz Posted March 27, 2012 Share Posted March 27, 2012 Hello ! I try to add metatags (title, description, keywords) on my module but i didn't success Here is my problem: I created a module to access a static page similar to that site http://www.mywatchy....on.mywatchy.php I try to force the meta in smarty like this : //Meta tags $mytitle="Mon super titre"; $mydescription="Ma super description"; $mykeywords="Mes supers mots clés"; $smarty->assign(array( 'meta_title' => mb_convert_encoding($mytitle, "UTF-8"), 'meta_description' => mb_convert_encoding($mydescription, "UTF-8"), 'meta_keywords' => mb_convert_encoding($mykeywords, "UTF-8"))); } When I throw the smarty debug console on my page I get this $meta_description Smarty_Variable Object (3) ->value = "Ma super description" ->nocache = false ->scope = "Smarty root" $meta_keywords Smarty_Variable Object (3) ->value = "Mes supers mots clés" ->nocache = false ->scope = "Smarty root" $meta_title Smarty_Variable Object (3) ->value = "Mon super titre" ->nocache = false ->scope = "Smarty root" But the meta are not display and the title is still the website's name. Do you have any idea ? Link to comment Share on other sites More sharing options...
fruizz Posted March 29, 2012 Author Share Posted March 29, 2012 Any idea ? Link to comment Share on other sites More sharing options...
fruizz Posted April 2, 2012 Author Share Posted April 2, 2012 Up ! Link to comment Share on other sites More sharing options...
BWT Posted April 3, 2012 Share Posted April 3, 2012 Manually edit the header.tpl file in your theme folder with the metadata, keyword, and description you want Link to comment Share on other sites More sharing options...
pratikprajapati540 Posted April 4, 2012 Share Posted April 4, 2012 In BO -> catalog -> add products i cannot add content for Short description in rich text editor in mozilla firefox only.. but it works in google crome. any one has any idea about this issue Link to comment Share on other sites More sharing options...
Slava Posted July 30, 2012 Share Posted July 30, 2012 I would like to join to the question of fruizz. Is there any way to do that? Link to comment Share on other sites More sharing options...
BWT Posted July 30, 2012 Share Posted July 30, 2012 (edited) We are using .PHP files so you don't need to edit each page/"module" as I said before if you want to manually add metadata to fource it. Open themes/your-theme/header.tpl file and add the content you want in addition to that edit the admin/header.inc.php file Edited July 30, 2012 by tjg (see edit history) Link to comment Share on other sites More sharing options...
BWT Posted July 30, 2012 Share Posted July 30, 2012 In BO -> catalog -> add products i cannot add content for Short description in rich text editor in mozilla firefox only.. but it works in google crome. any one has any idea about this issue Are you trying to copy & paste it? if so in firefox you need to allow for coy & paste Link to comment Share on other sites More sharing options...
Slava Posted July 30, 2012 Share Posted July 30, 2012 Hi! Thank you very much for your reply. I don't really want to change or add existing metadata. Everything is actually fine but I need to add meta title and description to my module. I mean I made module with my custom page. Now only shop name is displayed in page title. Meta description does not exist at all. I completely agree with that because title and desc are not assign anywhere. $smarty->assign('meta_title' , 'My_Title'); does't work I know one way to do that but is not quite elegant: - create in root dir my-module.php (file with the same name as php file in my module) (file don't have to contain anything, just exist) - go to BO->SEO->add new, choose my-module.php and fill the rest. Is there any other way to make it work without going beyond the module directory? Link to comment Share on other sites More sharing options...
Gaddy Posted October 12, 2012 Share Posted October 12, 2012 I tried the non elegantr way. It doesnt work for me. I still get the default title Link to comment Share on other sites More sharing options...
Slava Posted October 12, 2012 Share Posted October 12, 2012 I tried the non elegantr way. It doesnt work for me. I still get the default title Hi! I'll try to help but you have to write more about. What ver. PS? and what did you do? Link to comment Share on other sites More sharing options...
Gaddy Posted October 13, 2012 Share Posted October 13, 2012 I am using prestashop 1.4.8.2. I created a new php pahe called faqs.php in the root folder then copy pasted the code from the faqs.php fage from the modules/faq folder. Then i went to admin panel and in prefrences/seo&url i selected add new and chose the pagge faqs.php and filled in the seo information like title meta tags and meta description. and also the friendly url But when i go to the page using the friendly url it works it goes to the page but is unable to show the meta description and title and keywords that i have filled in. I think the code in faqs.php somehow overrides the seo info that i filled in Thnks for the reply. I am grateful. Link to comment Share on other sites More sharing options...
Vadimuch Posted July 27, 2018 Share Posted July 27, 2018 <meta charset="utf-8" /> <title>{if $p != 1 and $page_name == 'category'}({$p})- {l s='Страница'} {/if}{if $p != 1 and $page_name == 'new-products'}({$p})- {l s='Страница'} {/if}{if $p != 1 and $page_name == 'prices-drop'}({$p})- {l s='Страница'} {/if}{if $page_name == 'product'}{l s='Купить'} {$product->name|escape:'html':'UTF-8'} - Название магазина ✓ {$product->reference|escape:'html':'UTF-8'}{else}{$meta_title|escape:'html':'UTF-8'}{/if}</title> <meta name="description" content="{if $p != 1 and $page_name == 'category'}({$p})- {l s='Страница'} {/if}{if $page_name == 'product'}{l s='Купить'} {$product->name|escape:'html':'UTF-8'}{l s=' ➨ в магазине Название магазина ✓'} {else} {$meta_description|escape:'html':'UTF-8'}{/if}" /> Попробуйте это решение - мне помогло избавиться от дублей и +упростило жизнь СЕО-шникам. Link to comment Share on other sites More sharing options...
urgise Posted March 14, 2019 Share Posted March 14, 2019 On 7/27/2018 at 12:41 PM, Vadimuch said: <meta charset="utf-8" /> <title>{if $p != 1 and $page_name == 'category'}({$p})- {l s='Страница'} {/if}{if $p != 1 and $page_name == 'new-products'}({$p})- {l s='Страница'} {/if}{if $p != 1 and $page_name == 'prices-drop'}({$p})- {l s='Страница'} {/if}{if $page_name == 'product'}{l s='Купить'} {$product->name|escape:'html':'UTF-8'} - Название магазина ✓ {$product->reference|escape:'html':'UTF-8'}{else}{$meta_title|escape:'html':'UTF-8'}{/if}</title> <meta name="description" content="{if $p != 1 and $page_name == 'category'}({$p})- {l s='Страница'} {/if}{if $page_name == 'product'}{l s='Купить'} {$product->name|escape:'html':'UTF-8'}{l s=' ➨ в магазине Название магазина ✓'} {else} {$meta_description|escape:'html':'UTF-8'}{/if}" /> Попробуйте это решение - мне помогло избавиться от дублей и +упростило жизнь СЕО-шникам. Hi Vadimuch can you update the lines for presta 1.7? It doesnt work with 1.7. Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now