'Custom Page Title' replaced by TitleByJMenu on category view?

Started by Miku, July 22, 2016, 20:31:43 PM

Previous topic - Next topic

Miku

Hi,
I noticed that I have had very poor Google indexing recently when it comes to the category page. I'm just an ordinary user but the problem seems to have something to do with the 'Custom Page Title' for category in Meta Information. Specifically searching for a reason of that poor Google indexing I came across to the topic:
http://forum.virtuemart.net/index.php?topic=134434.0
As you can read it refers to that problem - problem of ignoring 'Custom Page Title'. For me it's the same - whatever data I have written in that field - the custom page title is actually the title of J! item menu. No option to change that. Solution suggested by the user:
QuoteI took the file \components\com_virtuemart\views\category\view.html.php from VirtueMart 3.0.14. Tiltles in cat work correctly.
Unfotunatelly doesn't work for me...

So can it be that those simple J! items menu instead of 'Custom Page Title' affect so decreasingly on the Google indexing? Is that a general issue with VM?

VirtueMart 3.0.16
Joomla! 3.6.0   

jenkinhill

Tested VM3.0.17.4 on J3.6 with Protostar & default VM templates. The Custom Page Title shows as the title for the category pages, not affected by Joomla menu item.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Miku

Yes - VM3.0.17.4 did the trick. Thank you jenkinhill
But plese tell me now what should I do to undone this poor Google indexing done by VM 3.0.16? Shall I just wait till Google "catch" those new data? Or there's a need of some manual changes in that matter?

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

saraheagle

I had this problem in vm 3.0.16. I think the line $document->setTitle( $title ); is in the wrong place.
I put it at the end of all the if statements and it works as it should


// 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);

  if(vRequest::getInt('error')){
$title .=' '.vmText::_('COM_VIRTUEMART_PRODUCT_NOT_FOUND');
}
if(!empty($keyword)){
$title .=' ('.strip_tags(htmlspecialchars_decode($keyword)).')';
}

if ($virtuemart_manufacturer_id>0 and !empty($this->products['0'])){

if (!empty($this->products['0'][0])) $title .=' '.$this->products['0'][0]->mf_name ;
$document->setTitle( $title );
// Override Category name when viewing manufacturers products !IMPORTANT AFTER page title.
if (!empty($this->products['0'][0]) and isset($category->category_name)) $category->category_name = $this->products['0'][0]->mf_name ;

}
               
               //These 3 lines are added to make it work
if ($title) {
$document->setTitle($title);
}

GJC Web Design

the setTitles, addtags etc will over write each other in the code hierarchy so if it works fine,

but they work just as well in the templates (if the vars are available there etc) so this will avoid them getting over written
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