Absolute ignoring Custom Titles on category pages

Started by Piombo, June 07, 2016, 11:35:01 AM

Previous topic - Next topic

Piombo

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)




GJC Web Design

$this->setTitleByJMenu() is only called if the cat title is empty

$title = (test); ???

$title = 'this is a title';
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Piombo

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!  :'(

GJC Web Design

meta title being over ridden in the template maybe?

find where $title is used
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Piombo

$title not found nowhere in the template\my-template\*.*


GJC Web Design

so where is it used?

look further in the code for

e.g. $document->setTitle(.....
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Piombo

#6
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'));

GJC Web Design

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
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Piombo

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.