News:

Looking for documentation? Take a look on our wiki

Main Menu

subcategory title not displayed as browser title

Started by dirkb, July 13, 2016, 10:26:01 AM

Previous topic - Next topic

dirkb

Joomla 3.5.1 - VM 3.0.16

Hi ... I´m dumbstruck (again). Shouldn´t the browser page title also display the subcategory name ?

It shows the main category name correctly, If I click on the subcategory, it still shows me the main category in the browser page title. If I click on a product, it shows the product name correctly in the browser page title.

Interesting enough ... the <meta name="title" content="sub-category name" /> is displayed correctly, but not the <title>subcategory</title>

Example:

Top level category I get ...

<meta name="title" content="main category" />
  <title>main category</title>

2nd level I get

<meta name="title" content="sub-category" />
  <title>main category</title>

Is there a way to control that ? I see that as wrong, but cannot find a solution for that ?

AH

Post a link to your site so someone can take a look

There are many options for modifying these meta tags
Regards
A

Joomla 4.4.5
php 8.1


dirkb

Hmmm ... I kind of got it to work by adding a custom page title snippet here from the board - just had to comment out some part, because it was repeating the subcategory and it show twice in the title tag ...

html/com_virtuemart/category/default.php

$document = JFactory::getDocument();
$newTitle = '';
// Set the titles
if ($this->product->customtitle) {
   $document->setTitle(strip_tags(html_entity_decode($this->product->customtitle,ENT_QUOTES)));
} else {
   $newTitle .= $this->category->category_name. '';
   $document->setTitle(strip_tags(html_entity_decode($newTitle,ENT_QUOTES)));
}