PDA

View Full Version : Can't find variable name


Vialli
21-05-07, 23:04
Hope somebody can help.

I have used {$sProductName} to output the product name in an area of my site.

I am trying to do the same for the category page, does anybody know the variable name to be used for the Category Name.

I have viewed a lot of the code and have tried various category related variables but nothing has worked.

Hope the above makes sense.

authcode
22-05-07, 09:07
I didn't use the client cos I've never used smarty so I could be wrong but you could try $sTreeTitle
as defined in category_tree.php

Vialli
22-05-07, 19:39
Thanks Steve, that does add the category name, however it is the sub categories I need to show, didn't think or realise it at the time.

Any ideas?

authcode
23-05-07, 16:52
Sub categories look to be in $aCategories

Vialli
23-05-07, 23:12
Thanks Steve, we are nearly yeah, outputs 'array' as opposed to the sub category, but thanks for taking the time to respond.

authcode
24-05-07, 11:38
You just need to loop through it to get the sub-cats:

foreach ($aCategories as $oCategory) {
echo $oCategory->sName;
}


or you can use:

print_r($aCategories);

as a debug option to see the contents of the array.

Vialli
24-05-07, 20:45
you're a star Steve, Many Thanks