Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Modify TITLE and set additional header in a specific page


Guest

Recommended Posts

Posted

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.

Posted

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

Posted

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.

Posted

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...