VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: Ventsi Genchev on July 29, 2019, 13:47:41 PM

Title: Manufacturer Details - Not Mobile Friendly
Post by: Ventsi Genchev on July 29, 2019, 13:47:41 PM
I received a notice from Google that pages with details of manufacturers are not mobile friendly.
After I checked, I found that Google was referring to the pages that ended with "?tmpl=component". For example:
https://demo.virtuemart.net/manufacturers/istraxx?tmpl=component

These pages open independently and not according to the site's design.

Where the problem comes from:
Normally these pages are opened by popup. But Google indexes them and it's not a good idea to stop indexing.
The problem is that these pages do not contain meta id "viewport".

To solve the described problem, I added to:
/templates/theme_name/html/com_virtuemart/manufacturer/details.php
The following:
$document = JFactory::getDocument();
$document->addCustomTag('<meta id="viewport" name="viewport" content="width=device-width, initial-scale=1">');


Please share if someone has a better idea.
Title: Re: Manufacturer Details - Not Mobile Friendly
Post by: StefanSTS on July 29, 2019, 15:21:14 PM
Hi,

the popup is normally opened in your templates component.php which shows no modules and other unwanted stuff in a popup.
You might want to add these things to your component.php itself, it should be already there in a good template.

Regards
Stefan
Title: Re: Manufacturer Details - Not Mobile Friendly
Post by: Ventsi Genchev on July 29, 2019, 16:00:42 PM
Hi Stefan,

Thank you for your advice.
You are absolutely right. It must be there, but it is not.

I do not want to tell which company the template is, but I had to rewrite it all to work properly. This one with a component.php I obviously missed it.
Now everything is OK.

Thank you and best regards,
Ventsi
Title: Re: Manufacturer Details - Not Mobile Friendly
Post by: Studio 42 on July 29, 2019, 17:06:39 PM
Because it's a modal, add a robots.txt rule to prevent google to index and verify this files.
or modify the link(use nofollow,noindex ... for eg.)
Title: Re: Manufacturer Details - Not Mobile Friendly
Post by: PRO on July 29, 2019, 19:54:50 PM
Your tmpl=component   should ALWAYS be noindex


your template/component.php


$doc =JFactory::getDocument();
$doc->setMetaData( 'robots', 'noindex' );
Title: Re: Manufacturer Details - Not Mobile Friendly
Post by: Ventsi Genchev on July 30, 2019, 06:48:27 AM
Thanks everyone for the tips.

I added the following:
$doc->setMetaData('robots', 'noindex, nofollow, noarchive, nosnippet');