Hi,
The title (alt) in my category tree links are now showing the category description (which is quite long). I want to show the meta description instead.
I (guess I) know which files I have to edit:
modules/blockcategories/blockcategories.php
public function getTree($resultParents, $resultIds, $maxDepth, $id_category = 1, $currentDepth = 0)
{
global $link;
$children = array();
if (isset($resultParents[$id_category]) AND sizeof($resultParents[$id_category]) AND ($maxDepth == 0 OR $currentDepth < $maxDepth))
foreach ($resultParents[$id_category] as $subcat)
$children[] = $this->getTree($resultParents, $resultIds, $maxDepth, $subcat['id_category'], $currentDepth + 1);
if (!isset($resultIds[$id_category]))
return false;
return array('id' => $id_category, 'link' => $link->getCategoryLink($id_category, $resultIds[$id_category]['link_rewrite']),
'name' => $resultIds[$id_category]['name'], 'desc'=> $resultIds[$id_category]['description'],
'children' => $children);
}
modules/blockcategories/category-tree-branch.tpl
<a href="{$node.link}" {if isset($currentCategoryId) && ($node.id == $currentCategoryId)}class="selected"{/if} title="{$node.desc|escape:html:'UTF-8'}">{$node.name|escape:html:'UTF-8'}</a>
I kinda understand the code, however I lack the skill of adding new features. Can someone help to let the function getTree also return the category's meta description?
Thanks!