Main and Sub categories in Page Title

compnet

No avatar

2007-11-12 10:17

Hello everybody.

I am wondering how to display the product main and sub categories in the title header of the page details, similar to a bread crumb navigation. Currently, it only displays the main or sub cats as page title headers.

Let us say I have the main cat "Monitors" which has 2 sub cats "Sony" and "Viewsonic"

Monitors
- Sony
- Viewsonic

How do I get to display the header page title " MONITOR"
when the monitor section is clicked, and "MONITOR / SONY" as header page title when sony is clicked.

Thanks in advance for your help

» Quick.Cart v2.x

compnet

No avatar

2007-11-12 15:01

Did some digging and found out that $aData[iParent] returns an integer that corresponds to the correct parent category. How to convert the integer to the correct category name?

Any help would be greatly appreciated.

compnet

No avatar

2007-11-13 08:48

Hi,
maybe what i am asking isnt clear. I would simply like to know how to have the main category , followed by the secondary category in the Page header title.

For instance, I have the following
MONITORS
- Sony
- Viewsonic

Then once you are looking at the viewsonic page, the page header title shows "MONITORS / Viewsonic" instead of just displaying Viewsonic as it is currently.

<h2>$aData['iParent'] / $aData[sName]</h2> in contents_details.tpl returns 31 / Viewsonic and I need help to convert the parent category id to it's corresponding name.

Thanks

merci

No avatar

2007-11-13 09:15

compnet - you should in file index.php after following code:

$sTitleBefore   $aData['sName'].' - ';


add this:


if( is_numeric$aData['iParent'] ) && $aData['iParent'] > && isset( $oCategory->aData[$aData['iParent']] ) ){
     
$sTitleBefore $oCategory->aData[$aData['iParent']]['sName'].' / '.$sTitleBefore;
   }

compnet

No avatar

2007-11-13 09:21

Hi merci,
merci for the reply. I tried your suggestion, but it is not returning the name/value of the parent category id.

Any other pointers.

compnet

No avatar

2007-11-13 09:29

I apologize if I was unclear.
$aData[sName] still returns the secondary category alone without the parent main category to which it belongs.

Thanks

compnet

No avatar

2007-11-13 09:37

Merci, your code is working.

I was not referring Title Page meta tag, but rather to the page header title found in contents_details.tpl.

Thanks in advance for your help.

compnet

No avatar

2007-11-13 09:42

I changed the variable name and added it to the tpl file and it worked. Thanks a bunch merci.

Back to top
about us | contact