Malakomaha Posted August 21, 2008 Share Posted August 21, 2008 So, now we have titles of the pages with products of any manufacturer like "My_Shop_Name".I want: when I click for manufacturer (for example) SONY the page title makes "www.mydomen.com - SONY"? Link to comment Share on other sites More sharing options...
Malakomaha Posted August 24, 2008 Author Share Posted August 24, 2008 Anyone knows..? Link to comment Share on other sites More sharing options...
bramp Posted August 24, 2008 Share Posted August 24, 2008 You would no doubt have to edit your header.tpl template file. However I just tried this by changing the line: <title>{$meta_title|escape:'htmlall':'UTF-8'}</title> to <title>{$meta_title|escape:'htmlall':'UTF-8'}{$manufacturer->name|escape:'htmlall':'UTF-8'}</title> or <title>{$meta_title|escape:'htmlall':'UTF-8'} {$path}</title> The first should display the manufactor's name, the second tried to put the breadcrumb line in the title. However both failed to work. I suspect the header is loaded and parsed before the breadcrumb or manufacturer's name is known.Unless someone else knows a clever way to make this work, then I suspect some hacks to the PHP are needed.sorryAndrew Link to comment Share on other sites More sharing options...
bramp Posted August 24, 2008 Share Posted August 24, 2008 oh, I bet javascript could do it, in fact it can. This is a bit of a hack, but in manufacturer.tpl place the following code [removed] document.title = "{$manufacturer->name|escape:'htmlall':'UTF-8'}"; [removed] Edit: it seems my opening and closing javascript tags were removed. They should look like the ones here: http://snippets.dzone.com/posts/show/2617This will use javascript to change the page's title.enjoyAndrew Link to comment Share on other sites More sharing options...
Malakomaha Posted August 24, 2008 Author Share Posted August 24, 2008 I have changed in header.tpl <title>{$meta_title|escape:'htmlall':'UTF-8'}</title> to <title>{$meta_title|escape:'htmlall':'UTF-8'}{$manufacturer->name|escape:'htmlall':'UTF-8'}</title> and in manufacturer.tpl inserted code which U told (on picture). Pages with any manufacturers became empty, and title didn't change :-S Link to comment Share on other sites More sharing options...
bramp Posted August 24, 2008 Share Posted August 24, 2008 I think there was a bit of a misunderstanding... The first way I suggested would be the best way, but it doesn't work. So there is no need to change header.tpl.With the second way I see you copied and pasted the site I linked to, but you didn't need to copy everything on that site. You'll notice my code document.title = "{$manufacturer->name|escape:'htmlall':'UTF-8'}"; didn't have function changeTitle(title) { ... } with it. You should remove that it hopefully it will work.Andrew Link to comment Share on other sites More sharing options...
Malakomaha Posted August 24, 2008 Author Share Posted August 24, 2008 Thx, it work.It would be also great to have <Title> tag with Manufacturer name in the HTML code of a page.This is good for search results by search engines. Link to comment Share on other sites More sharing options...
Malakomaha Posted October 6, 2008 Author Share Posted October 6, 2008 So,nobody knows how to change Meta Title in page with product list of the manufacturer (e.g. Sony) from those which set inBack Office --> Preferences --> Appearance(e.g. "Myshop.com - best shop in the world")to"Myshop.com - Sony"or"Sony - Myshop.com" ? Link to comment Share on other sites More sharing options...
Bruz Posted November 28, 2008 Share Posted November 28, 2008 Nothing new here? I also need that desperatly! The title-Tag should contain the manufacturer's name and the meta-description the manufacturer's description!Google Webmaster-Tools is reporting problems because I have dozens of pages with the same title-tag! Link to comment Share on other sites More sharing options...
Paul C Posted November 28, 2008 Share Posted November 28, 2008 Hmmm, this has got me thinking now..... must be an elegant way of doing this somehow......... wanders off scratching head.....Paul Link to comment Share on other sites More sharing options...
Bruz Posted November 28, 2008 Share Posted November 28, 2008 Come back soon, please :-)But seriously - this is a major issue that needs to be solved! I've also tried some code directly from manufacturer-list.tpl, but no success so far Link to comment Share on other sites More sharing options...
Gregory Roussac Posted November 29, 2008 Share Posted November 29, 2008 Welll hmmm,Something like this should work in Tools.php in method getMetaTags /* Products specifics meta tags */ if ($id_product = Tools::getValue('id_product')) { $row = Db::getInstance()->getRow(' SELECT pl.`name`, `meta_title`, `meta_description`, `meta_keywords`, m.`name` `manufacturer_name` FROM `'._DB_PREFIX_.'product_lang` pl LEFT JOIN `'._DB_PREFIX_.'manufacturer_` m ON (m.id_manufacturer = pl.id_product) WHERE id_lang = '.intval($id_lang).' AND id_product = '.intval($id_product)); if ($row) return self::completeMetaTags(self::completeMetaTags($row, $row['name'].' - '.$row['manufacturer_name'])); } Not tested no warranty !FYI metas are being created in core not in theme !!!Regards Link to comment Share on other sites More sharing options...
Bruz Posted November 29, 2008 Share Posted November 29, 2008 That may be the dumbest question ever - but how do you call this in the header.tpl? Link to comment Share on other sites More sharing options...
Bruz Posted December 2, 2008 Share Posted December 2, 2008 Hi Gregory,thank you - I've edited Tool.php but that is not working as it should...<title>Product - Manufacturer - 1st Category - Sitename is what I need for single product-pages,<title>Manufacturer - Sitename for the manufacturers and<title>1st Category - 2nd Category - ... - Sitename</title> for category-pagesIt's so important, see attatched image!I think I'll start a new topic for all this SEO-related stuff, we've also need the meta-tags diplayed right when set for a manufacturer! Link to comment Share on other sites More sharing options...
Recommended Posts