News:

Support the VirtueMart project and become a member

Main Menu

page title of category with id = 0

Started by adriespo, September 25, 2014, 23:03:37 PM

Previous topic - Next topic

adriespo

I have problems with this pseudocategory.

In example I need to set a customtitle.

Infact the code in \components\com_virtuemart\views\category\view.html.php ends with show me the title 'VirtueMart Category View' when I load a category page with id 0

Now I wonder if there is a manner to set the customtitle to this pseudocategory. I was thinking to create a real category in db with id 0.

I still have other problems related to this pseudocategory like the one here: http://forum.virtuemart.net/index.php?topic=125804.0

// Set the titles
if (!empty($category->customtitle)) {
        $title = strip_tags($category->customtitle);
      } elseif (!empty($category->category_name)) {
      $title = strip_tags($category->category_name);
} else {
$title = $this->setTitleByJMenu($app);
}

public function setTitleByJMenu($app){
$menus = $app->getMenu();
$menu = $menus->getActive();

$title = 'VirtueMart Category View';
if ($menu) $title = $menu->title;
// $title = $this->params->get('page_title', '');
// Check for empty title and add site name if param is set
if (empty($title)) {
$title = $app->getCfg('sitename');
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 1) {
$title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 2) {
$title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
}
vmdebug("title", $title);
return $title;
}

adriespo

Well, I managed adding a new costant COM_VIRTUEMART_CATEGORY_DEFAULT_TITLE, overriding it in Joomla 2.5 override settings and changing the row

$title = 'VirtueMart Category View';

in

$title = JText::_('COM_VIRTUEMART_CATEGORY_DEFAULT_TITLE');

But because \components\com_virtuemart\views\category\view.html.php  is not overridable I will lose it when I will update VM...

So I would like to see a similar solution in a next update, if expected.

Thank you.