News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Page Title Missing after upgrade to 2.0.20a - Expert needed

Started by Giladd, March 18, 2013, 12:14:49 PM

Previous topic - Next topic

Giladd

hello,

i updated to 2.0.20b (from the previous version) few days ago and my home page title change to my menu title (not page title). i can't change it from the menu when i set the "page title" and also the "welcome to" store name is missing.
site URL - http://buycycle.co.il
please advice.

thank you.

Giladd

#1
hello,
i find that the problem is from the view.html.php file in components/com_virtuemart/views/virtuemart , i restore the old file on my test site and the problem solved, how ever my php skills are poor and i am not sure what to do on my prodaction site. i attached the to files - please advice.

thank you.

[removed, do not post the sourcecode of two files, no one will read it. Much more helpful is to give the exact revision number written in the head of the file]


Milbo

We just changed this
Quote
$document->setTitle(JText::sprintf('COM_VIRTUEMART_HOME',$vendor->vendor_store_name));

to

Quote
$app = JFactory::getApplication();
         $menus = $app->getMenu();
         $menu = $menus->getActive();
         if ($menu) $title = $menu->title;
         if(empty($title)) $title = JText::sprintf('COM_VIRTUEMART_HOME',$vendor->vendor_store_name);
         $document->setTitle($title)
Just remove the menu title and should have your old behaviour
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Giladd

thank you for your replay.

i not sure i understand the answer the menu title on the menu itself can't be empty, and the page title is all ready empty ..... what exactly do i need to change ? the view.html.php file ?

Giladd

hello Milbo,

I really need your help here before google came and index the site again. please advice what exactly i need to do to fix this problem ?

Milbo

Please try the attached file (remove the .txt)

url /components/com_virtuemart/views/virtuemart.

The difference is that you can choose now with the language override how it should look. It is just the second parameter

$title = JText::sprintf('COM_VIRTUEMART_HOME',$vendor->vendor_store_name,$menuTitle);

So if you want to use the storename: COM_VIRTUEMART_HOME="Welcome to %1$s"
if you want to use the menuTitle: COM_VIRTUEMART_HOME="Welcome to %2$s"
or both
COM_VIRTUEMART_HOME="Welcome to the %2$s of %1$s"  => Welcome to the home of myshop

[attachment cleanup by admin]
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

lindapowers


Giladd


nickwiebe

What code do you use here to allow the Pages Display Options in the Menu to work on the home page of my store?  I have made a customer Browser Page Title in the Menu item as well as custom description and keywords, but they don't show up in the page source or browser title.  Store defaults to the description and keywords from Joomla instead...any ideas on how to make this work?

thanks,

Nick

Milbo

Hehe :-) I think someone of the inner team had the same question and provided a patch, which we use now. Please try the latest version. In the store are new settings for the meta of the homepage http://forum.virtuemart.net/index.php?topic=115877.0
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

lindapowers

Quote from: Milbo on June 16, 2013, 20:02:12 PM
Hehe :-) I think someone of the inner team had the same question and provided a patch, which we use now. Please try the latest version. In the store are new settings for the meta of the homepage http://forum.virtuemart.net/index.php?topic=115877.0

Hi Max

Seems the VM2 backend option is not working, at least for us,  I have entered a title at the  SEO settings "shop" tab of VM2 config but is getting ignored.

Still shows.. welcome to "shopname" or "webpage name" (in our case is the same so dont know really which one is using)

Regards

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

lindapowers

Quote from: Milbo on June 17, 2013, 16:03:24 PM
You must remove the joomla settings!

Settings are removed, I have tested with default beez template in case it was a templating issue but shows the same: "welcome to blabla" ignoring completely the shop title entered at VM2.

Regards


ufo_hk

Hi,

Has this issue been resolved?
I'm using Joomla 2.5.11
Virtuemart 2.0.20b

and have the same issue - not able to Change Virtuemart home page title.

Thanks

PRO

This will do the actual page title in the "SEO settings" of the menu, and not the "menu title".
This code will not add the store name
for some reason the "JText::sprintf" does not do what it is supposed to do (when it tries to add $menuTitle)
The original code was getting the "Menu Item Name", but for some reason was not putting it in the page title.

see my notes // @PRO

      //Todo this may not work everytime as expected, because the error must be set in the redirect links.
      if(!empty($error)){
         $document->setTitle(JText::_('COM_VIRTUEMART_PRODUCT_NOT_FOUND').JText::sprintf('COM_VIRTUEMART_HOME',$vendor->vendor_store_name));
      } else {
         $app = JFactory::getApplication();
         $menus = $app->getMenu();
         $menu = $menus->getActive();
         $menuTitle = '';
         if ($menu){
         // @PRO Get the actual $menu param page title & not the menu title CHANGE the line below
            $menuTitle = $menu->params->get('page_title');
         }
         $title = JText::sprintf('COM_VIRTUEMART_HOME',$vendor->vendor_store_name,$menuTitle);
         // @PRO set the page title to exactly the menu page title if its filled in ADD this line
         if ($menu){$title=$menuTitle;}
         $document->setTitle($title);
         if(!empty($vendor->metadesc)) $document->setMetaData('description',$vendor->metadesc);
         if(!empty($vendor->metakey)) $document->setMetaData('keywords',$vendor->metakey);
         if(!empty($vendor->metarobot)) $document->setMetaData('robots',$vendor->metarobot);
         if(!empty($vendor->metaauthor)) $document->setMetaData('author',$vendor->metaauthor);

      }