SHANX6336 Posted December 27, 2004 Share Posted December 27, 2004 Hi, I became frustrated after I tried installing the Header Tags Controller and I am looking for an easy way to include a product's name in the <TITLE></TITLE> tag. By using the following code inside the <TITLE></TITLE> tag, it showed the title of any given page (i.e. About Us, Shipping, Contact Us: <TITLE><?php echo HEADING_TITLE; ?></TITLE> Now I wanted for the product's name to appear in the TITLE for the product_info.php file so that each individual product would have a unique title bar. I used the following code: <TITLE><?php echo $products_name; ?></TITLE> Using the products_name one did not work the same way. I was unsuccessful. Is there a code I can use that will work? Do I have to install the Headers Tag Controller contribution for this? Is there an easy way to do this? I am experienced in installing contributions but for some reason I had difficulty getting this one to work. I appreciate the assistance. Link to comment Share on other sites More sharing options...
markmca Posted December 27, 2004 Share Posted December 27, 2004 Hi, I became frustrated after I tried installing the Header Tags Controller and I am looking for an easy way to include a product's name in the <TITLE></TITLE> tag. By using the following code inside the <TITLE></TITLE> tag, it showed the title of any given page (i.e. About Us, Shipping, Contact Us: <TITLE><?php echo HEADING_TITLE; ?></TITLE> Now I wanted for the product's name to appear in the TITLE for the product_info.php file so that each individual product would have a unique title bar. I used the following code: <TITLE><?php echo $products_name; ?></TITLE> Using the products_name one did not work the same way. I was unsuccessful. Is there a code I can use that will work? Do I have to install the Headers Tag Controller contribution for this? Is there an easy way to do this? I am experienced in installing contributions but for some reason I had difficulty getting this one to work. I appreciate the assistance. <{POST_SNAPBACK}> put the following piece of code after the line require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO); $get_pname = tep_db_query("select pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $products= tep_db_fetch_array($get_pname); and then replace the title with the following code <title><?php echo $products['products_name']; ?></title> I think this should work for you :) Link to comment Share on other sites More sharing options...
SHANX6336 Posted December 30, 2004 Author Share Posted December 30, 2004 Thank you so much! That worked wonderfully. I tried to add the Product ID to the TITLE and it didn't work. Is there a similar fashion to include the individual product's ID as well? Link to comment Share on other sites More sharing options...
SHANX6336 Posted December 30, 2004 Author Share Posted December 30, 2004 Actually just to make my request clearer, how can the model model be shown in the TITLE bar? I thought saying Product ID may be confusing. Thanks again! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.