VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: dirkb on December 06, 2015, 19:05:15 PM

Title: VM 3.0.12 - navi link to category layout - browser page title cannot be changed
Post by: dirkb on December 06, 2015, 19:05:15 PM
Joomla 3.4.5 / VM 3.0.12

I have a menu link called "shop" linking to VM category layout.

If I go into the menu manager -> menu edit item -> page display -> browser page title

... it´s not changing the browser page title. Tried all the other menu entries, to frontpage and non-vm links, it works there, but not with "category layout"

anybody ideas ?
Title: Re: VM 3.0.12 - navi link to category layout - browser page title cannot be changed
Post by: Jumbo! on December 07, 2015, 09:06:26 AM
You easily fix that in your template's HTML override.

Example:

Open - templates/your_template/html/com_virtuemart/category/default.php

Find the following codes around the top:

defined ('_JEXEC') or die('Restricted access');

Replace above by:

defined ('_JEXEC') or die('Restricted access');

$doc = JFactory::getDocument();
$app = JFactory::getApplication();
$menus = $app->getMenu();
$menu = $menus->getActive();

if(!empty($menus))
{
$page_title = $menu->params->get('page_title');
if(!empty($page_title))
{
$doc->setTitle($page_title);
}
}
Title: Re: VM 3.0.12 - navi link to category layout - browser page title cannot be changed
Post by: dirkb on December 07, 2015, 09:51:26 AM
Hey Jumbo ... fix works. Perfect. Thank you.
Title: Re: VM 3.0.12 - navi link to category layout - browser page title cannot be changed
Post by: GJC Web Design on December 07, 2015, 12:24:33 PM
Should be in the core I guess... 
Title: Re: VM 3.0.12 - navi link to category layout - browser page title cannot be changed
Post by: FoTo50 on December 08, 2015, 11:49:55 AM
I agree to GJC, suggest to change ./views/category/view.html.php on line 308 from if ($menu) $title = $menu->title; to if ($menu) $title = $menu->params->get('page_title'); in one of the next versions and everything works from core as expected :)

Greetz