VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: Miku on July 22, 2016, 20:31:43 PM

Title: 'Custom Page Title' replaced by TitleByJMenu on category view?
Post by: Miku on July 22, 2016, 20:31:43 PM
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 (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   
Title: Re: 'Custom Page Title' replaced by TitleByJMenu on category view?
Post by: jenkinhill on July 22, 2016, 23:56:09 PM
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.
Title: Re: 'Custom Page Title' replaced by TitleByJMenu on category view?
Post by: Miku on July 23, 2016, 12:32:28 PM
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?
Title: Re: 'Custom Page Title' replaced by TitleByJMenu on category view?
Post by: jenkinhill on July 23, 2016, 13:45:10 PM
I usually let Google catch up on its own.
Title: [SOLVED] Re: 'Custom Page Title' replaced by TitleByJMenu on category view?
Post by: saraheagle on August 01, 2016, 16:10:13 PM
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);
}
Title: Re: 'Custom Page Title' replaced by TitleByJMenu on category view?
Post by: GJC Web Design on August 02, 2016, 15:56:15 PM
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