Guest Posted July 28, 2011 Posted July 28, 2011 Hi, I would like to modify the title and the content of the <head></head> in specific page (for an example : privacy.php) In the documentation (page 12,13), I read it is possible with the files includes in catalog/includes/modules/header_tags... I tried but I didn't succed. For example : I created a file named title.php (I also tried with ht_privacy_title.php). I save this file in catalog/includes/modules/header_tags/privacy/ (I also tried in catalog/includes/modules/header_tags) This file contains : **************** <?php class ht_privacy_title { function parse() { global $oscTemplate; $oscTemplate->setTitle('My new Title'); $oscTemplate->addHeaderTag('<link rel="stylesheet" type="text/css" href="new_stylesheet.css />'); } } ?> ********************* Of course, it didn't work... Can you help me please ? Thanks a lot.
vishalchauhan Posted July 28, 2011 Posted July 28, 2011 Hi, I would like to modify the title and the content of the <head></head> in specific page (for an example : privacy.php) In the documentation (page 12,13), I read it is possible with the files includes in catalog/includes/modules/header_tags... I tried but I didn't succed. For example : I created a file named title.php (I also tried with ht_privacy_title.php). I save this file in catalog/includes/modules/header_tags/privacy/ (I also tried in catalog/includes/modules/header_tags) This file contains : **************** <?php class ht_privacy_title { function parse() { global $oscTemplate; $oscTemplate->setTitle('My new Title'); $oscTemplate->addHeaderTag('<link rel="stylesheet" type="text/css" href="new_stylesheet.css />'); } } ?> ********************* Of course, it didn't work... Can you help me please ? Thanks a lot. Hi i am also new for osc 2.3.1 have you seen ht_category_title.php file in includes/modules/header_tags/ check for this line $oscTemplate->setTitle($categories['categories_name'] . ', ' . $oscTemplate->getTitle()); i know its not a perfect solution but may be it will help you. or you can use explicit code for change the title and head content in perticular page by putting logic like this, if(basename($PHP_SELF) == 'YOURFILENAME.php'){ $title = <title>YOUR TITLE</title> $head = <head> YOUR HEADER CONTENT </head> }else{ $title = <title>DEFAULT TITLE</title> $head = <head> DEFAULT HEAD CONTENT</head> } echo $title; echo $head; in header.php file. May be it will help you. :) Please take backup of your files before do changes suggested by me
Guest Posted July 28, 2011 Posted July 28, 2011 Thank you Vishalchauhan, i will test your idea. Nevertheless, I would prefer to understand how to do by using the "system" of header_tags which seems to be here for that.
♥toyicebear Posted July 28, 2011 Posted July 28, 2011 Install and use Header Tags SEO Basics for osC 2.2 Design - Basics for Design V2.3+ - Seo & Sef Url's - Meta Tags for Your osC Shop - Steps to prevent Fraud... - MS3 and Team News... - SEO, Meta Tags, SEF Urls and osCommerce - Commercial Support Inquiries - OSC 2.3+ How To To see what more i can do for you check out my profile [click here]
Guest Posted July 28, 2011 Posted July 28, 2011 Thank you Toyicebear. Header Tags SEO seems to be fine to modify title, keywords, etc. in specific page but it offers no solution to add other specific code in the <head> part.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.