Hello!
VirtueMart 3.0.16
Joomla 3.5.1
On product details everything works fine.
On the category pages I can do like this: components\com_virtuemart\views\category\view.html.php
// 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();
}
$title = vmText::_($title);
*/
$title = (test);
and
public function setTitleByJMenu(){
/*
$menus = $this->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 = $this->app->getCfg('sitename');
}
elseif ($this->app->getCfg('sitename_pagetitles', 0) == 1) {
$title = vmText::sprintf('JPAGETITLE', $this->app->getCfg('sitename'), $title);
}
elseif ($this->app->getCfg('sitename_pagetitles', 0) == 2) {
$title = vmText::sprintf('JPAGETITLE', $title, $this->app->getCfg('sitename'));
}
return $title;
*/
$title = 'Test2';
}
nothing changes ....
I would like to Title was a category name and\or Custom Title. Now the subject is the same for all categories. Plz help!
PS. I use in template mod_phoca_vm_category and mod_virtuemart_category. But I unpublish these modules
PSS. I deleted the cache (com_virtuemart_cats)
$this->setTitleByJMenu() is only called if the cat title is empty
$title = (test); ???
$title = 'this is a title';
it does not matter, if I write like this:
// 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();
}
$title = 'this is a title';
or like this:
// 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();
// }
//
// $title = 'this is a title';
nothing changes! :'(
meta title being over ridden in the template maybe?
find where $title is used
$title not found nowhere in the template\my-template\*.*
so where is it used?
look further in the code for
e.g. $document->setTitle(.....
request "$document->setTitle" is found in the files:
administrator\components\com_content\views\article\view.html.php
administrator\components\com_media\models\manager.php
components\com_virtuemart\views\askquestion\view.html.php
components\com_virtuemart\views\cart\view.html.php
components\com_virtuemart\views\category\view.html.php
components\com_virtuemart\views\invoice\view.html.php
components\com_virtuemart\views\invoice\tmpl\invoice.php
components\com_virtuemart\views\manufacturer\view.html.php
components\com_virtuemart\views\orders\view.html.php
components\com_virtuemart\views\productdetails\view.html.php
components\com_virtuemart\views\productdetails\tmpl\default_pdf.php
components\com_virtuemart\views\recommend\view.html.php
components\com_virtuemart\views\user\view.html.php
components\com_virtuemart\views\vendor\view.html.php
components\com_virtuemart\views\virtuemart\view.html.php
libraries\cms\application\administrator.php
libraries\cms\application\site.php
libraries\cms\error\page.php
libraries\fof\view\html.php
libraries\legacy\error\error.php
and, if I comment the line in components\com_virtuemart\views\category\view.html.php - nothing changes. "title" remains unchanged.
$document->setTitle( $title );
if I comment the line in libraries\cms\application\site.php - "title" collapsing :)
$document->setTitle($params->get('page_title'));
Quoteif I comment the line in components\com_virtuemart\views\category\view.html.php - nothing changes. "title" remains unchanged.
your either not on a cat view
or $document->setTitle is used after this
or your in the wrong file generally
or you are looking at cached output
Cache Settings - OFF - Caching disabled
I took the file \components\com_virtuemart\views\category\view.html.php from VirtueMart 3.0.14. Tiltles in cat work correctly.