[email protected] Posted February 13, 2005 Share Posted February 13, 2005 I know it's possible but cannot find anywhere to create a page title to display in the browser title bar. The answer must be simple but I cannot find any reference to it in the documentation (probably because it's too simple to bother with documentation!) or by searching the php files. Please could someone point me in the right direction. Many thanks Link to comment Share on other sites More sharing options...
WiseWombat Posted February 16, 2005 Share Posted February 16, 2005 I know it's possible but cannot find anywhere to create a page title to display in the browser title bar. The answer must be simple but I cannot find any reference to it in the documentation (probably because it's too simple to bother with documentation!) or by searching the php files. Please could someone point me in the right direction. Many thanks <{POST_SNAPBACK}> I think its in catalog/includes/languges/english.php ( WARNING ) I think I know what Im talking about. BACK UP BACK UP BACK UP BACK UP Link to comment Share on other sites More sharing options...
[email protected] Posted February 18, 2005 Author Share Posted February 18, 2005 I think its in catalog/includes/languges/english.php <{POST_SNAPBACK}> Many thanks for that Link to comment Share on other sites More sharing options...
Guest Posted February 18, 2005 Share Posted February 18, 2005 Also try this: <title><?php echo strip_tags($breadcrumb->trail(' » ')); ?></title> You can customise it in many diferent ways. :thumbsup: Link to comment Share on other sites More sharing options...
[email protected] Posted February 22, 2005 Author Share Posted February 22, 2005 Also try this: <title><?php echo strip_tags($breadcrumb->trail(' » ')); ?></title> You can customise it in many diferent ways. :thumbsup: <{POST_SNAPBACK}> Hey - that looks seriously interesting - many thanks Ray Link to comment Share on other sites More sharing options...
Chris Brown Posted June 28, 2007 Share Posted June 28, 2007 Thanks for this.... here's my little modification... <title><?php echo TITLE; ?> <?php echo substr(strip_tags($breadcrumb->trail(' » ')),20); ?></title> Adds the site name in front of the breadcrumbs and trims off the first 20 characters of the crumbs which is " Top » Catalog " CB Link to comment Share on other sites More sharing options...
vzdrale Posted September 17, 2007 Share Posted September 17, 2007 Also try this: <title><?php echo strip_tags($breadcrumb->trail(' » ')); ?></title> You can customise it in many diferent ways. :thumbsup: Hey guys, where do you put this line? In english.php or header.php, or you have to change all the files that are containing <title> tag? Link to comment Share on other sites More sharing options...
cookie_guy Posted October 5, 2007 Share Posted October 5, 2007 Hey guys, where do you put this line? In english.php or header.php, or you have to change all the files that are containing <title> tag? Hello Folks, Im using the STS System, and therefore in my includes/modules/sts_inc/general.php I Replaced: $sts->template['headertags']= "<title>" . TITLE ."</title>"; With: $sts->template['headertags'] = "<title>". TITLE .": ".substr(strip_tags($breadcrumb->trail(' » ')),7)."</title>"; Note that my trim is only "7" since my breadcrumbs are modified and I added a ": " Link to comment Share on other sites More sharing options...
CageRattler Posted October 17, 2007 Share Posted October 17, 2007 Hello Folks, Im using the STS System, and therefore in my includes/modules/sts_inc/general.php I Replaced: $sts->template['headertags']= "<title>" . TITLE ."</title>"; With: $sts->template['headertags'] = "<title>". TITLE .": ".substr(strip_tags($breadcrumb->trail(' » ')),7)."</title>"; Note that my trim is only "7" since my breadcrumbs are modified and I added a ": " This is important stuff for search engine optimization. Thanks for posting that elegant fix. I wasn't happy with the way breadcrumbs worked out in my particular store because I have a lot of custom pages without breadcrumbs, and I'm only using one language, so I went back to the mySQL functions and wrote it this way: In: includes/modules/sts_inc/general.php At around line 68, comment out the same line mentioned in the posts above: //$sts->template['headertags']= "<title>" . TITLE ."</title>"; Then add this: //<<<<<<<<<<<<<<<<<<<<<<<<<<<<SEOTITLE>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> $generalStoreFocus = "";//Place a word about your general store focus here if you like if($_GET['cPath']){ $n = $_GET['cPath']; $sql = 'SELECT `categories_name` FROM `categories_description` WHERE language_id = 1 AND categories_id = '.$n; $query = tep_db_query($sql); $qArray = tep_db_fetch_array($query); $titleCat = $qArray['categories_name']; $titleProd = ""; if($_GET['products_id']){ $n = $_GET['products_id']; $sql = 'SELECT `products_name` FROM `products_description` WHERE products_id = '.$n; $query = tep_db_query($sql); $qArray = tep_db_fetch_array($query); $titleProd = ": ".$qArray['products_name']; } if($generalStoreFocus != ""){ $generalStoreFocus .= " "; } $SEOTitle= $generalStoreFocus.$titleCat.$titleProd." from ".STORE_NAME; }else{ $SEOTitle=TITLE; } $sts->template['headertags']= "<title>" . $SEOTitle ."</title>"; //<<<<<<<<<<<<<<<<<<<<<<<<<<END SEOTITLE>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Link to comment Share on other sites More sharing options...
tonedoggydogg Posted November 16, 2007 Share Posted November 16, 2007 I think its in catalog/includes/languges/english.php For those of us just using osCommerce with no template system, yes it's in catalog/includes/languges/english.php, and it's on or near line #48 in that file. You'll probably need to change it for each language. e.g. english.php, german.php, etc. Change the following line: define('TITLE', 'osCommerce'); Change 'osCommerce' to the name of your store or whatever you want. Be sure to keep the single quotes: define('TITLE', 'New Name of My Store'); Link to comment Share on other sites More sharing options...
tonedoggydogg Posted November 16, 2007 Share Posted November 16, 2007 For those of us just using osCommerce with no template system, yes it's in catalog/includes/languges/english.php, and it's on or near line #48 in that file. You'll probably need to change it for each language. e.g. english.php, german.php, etc. Change the following line: define('TITLE', 'osCommerce'); Change 'osCommerce' to the name of your store or whatever you want. Be sure to keep the single quotes: define('TITLE', 'New Name of My Store'); The same applies to the admin area at catalog/admin/includes/languages/english.php on line #43. This changes the <TITLE> of the admin area. Link to comment Share on other sites More sharing options...
toyzonline Posted January 11, 2008 Share Posted January 11, 2008 This is important stuff for search engine optimization. Thanks for posting that elegant fix. I wasn't happy with the way breadcrumbs worked out in my particular store because I have a lot of custom pages without breadcrumbs, and I'm only using one language, so I went back to the mySQL functions and wrote it this way: In: includes/modules/sts_inc/general.php At around line 68, comment out the same line mentioned in the posts above: //$sts->template['headertags']= "<title>" . TITLE ."</title>"; Then add this: //<<<<<<<<<<<<<<<<<<<<<<<<<<<<SEOTITLE>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> $generalStoreFocus = "";//Place a word about your general store focus here if you like if($_GET['cPath']){ $n = $_GET['cPath']; $sql = 'SELECT `categories_name` FROM `categories_description` WHERE language_id = 1 AND categories_id = '.$n; $query = tep_db_query($sql); $qArray = tep_db_fetch_array($query); $titleCat = $qArray['categories_name']; $titleProd = ""; if($_GET['products_id']){ $n = $_GET['products_id']; $sql = 'SELECT `products_name` FROM `products_description` WHERE products_id = '.$n; $query = tep_db_query($sql); $qArray = tep_db_fetch_array($query); $titleProd = ": ".$qArray['products_name']; } if($generalStoreFocus != ""){ $generalStoreFocus .= " "; } $SEOTitle= $generalStoreFocus.$titleCat.$titleProd." from ".STORE_NAME; }else{ $SEOTitle=TITLE; } $sts->template['headertags']= "<title>" . $SEOTitle ."</title>"; //<<<<<<<<<<<<<<<<<<<<<<<<<<END SEOTITLE>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Is there anything like this for those not using STS as having problems with custom meta tags and everything helps Complete Newbie On The Learn - Not A Programmer But Learning As I Go Link to comment Share on other sites More sharing options...
ianric Posted January 11, 2008 Share Posted January 11, 2008 Thanks for this.... here's my little modification... <title><?php echo TITLE; ?> <?php echo substr(strip_tags($breadcrumb->trail(' » ')),20); ?></title> Adds the site name in front of the breadcrumbs and trims off the first 20 characters of the crumbs which is " Top » Catalog " CB Hi Use this code. Works for me. Used in all main pages. I had to change the 20 to 4. Just play around with this number until it looks right. See it in action at www.icr-records.co.uk Cheers Ian Link to comment Share on other sites More sharing options...
Guest Posted June 2, 2008 Share Posted June 2, 2008 ok got a strange problem tried all the suggestions above and they work fine in firefox but the title doesnt change at all in IE7 it just says E-commerce which is what it said from when the site was installed any idea's guys? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.