VirtueMart Forum

VirtueMart 2 + 3 + 4 => Installation, Migration & Upgrade => Topic started by: Giladd on March 18, 2013, 12:14:49 PM

Title: Page Title Missing after upgrade to 2.0.20a - Expert needed
Post by: Giladd on March 18, 2013, 12:14:49 PM
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 (http://buycycle.co.il)
please advice.

thank you.
Title: Re: Page Title Missing after upgrade to 2.0.20a
Post by: Giladd on March 18, 2013, 13:47:48 PM
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]

Title: Re: Page Title Missing after upgrade to 2.0.20a - Expert needed
Post by: Milbo on March 18, 2013, 15:41:34 PM
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
Title: Re: Page Title Missing after upgrade to 2.0.20a - Expert needed
Post by: Giladd on March 19, 2013, 08:37:02 AM
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 ?
Title: Re: Page Title Missing after upgrade to 2.0.20a - Expert needed
Post by: Giladd on March 20, 2013, 06:30:09 AM
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 ?
Title: Re: Page Title Missing after upgrade to 2.0.20a - Expert needed
Post by: Milbo on March 20, 2013, 12:35:03 PM
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]
Title: Re: Page Title Missing after upgrade to 2.0.20a - Expert needed
Post by: lindapowers on March 20, 2013, 19:39:20 PM
Thanks a lot Milbo, this was driving me crazy.
Title: Re: Page Title Missing after upgrade to 2.0.20a - Expert needed
Post by: Giladd on March 21, 2013, 08:39:23 AM
thank you very much - this solved the problem
Title: Re: Page Title Missing after upgrade to 2.0.20a - Expert needed
Post by: nickwiebe on June 14, 2013, 18:13:04 PM
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
Title: Re: Page Title Missing after upgrade to 2.0.20a - Expert needed
Post by: 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
Title: Re: Page Title Missing after upgrade to 2.0.20a - Expert needed
Post by: lindapowers on June 16, 2013, 22:39:39 PM
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
Title: Re: Page Title Missing after upgrade to 2.0.20a - Expert needed
Post by: Milbo on June 17, 2013, 16:03:24 PM
You must remove the joomla settings!
Title: Re: Page Title Missing after upgrade to 2.0.20a - Expert needed
Post by: lindapowers on June 20, 2013, 01:51:37 AM
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

Title: Re: Page Title Missing after upgrade to 2.0.20a - Expert needed
Post by: ufo_hk on July 03, 2013, 00:34:06 AM
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
Title: Re: Page Title Missing after upgrade to 2.0.20a - Expert needed
Post by: PRO on July 03, 2013, 04:44:22 AM
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);

      }
Title: Re: Page Title Missing after upgrade to 2.0.20a - Expert needed
Post by: franzpeter on July 04, 2013, 16:38:57 PM
Giladd, I hope that the new VM update will get published soon. There you can define an alternative page title, meta keywords, metadescriptions, meta robots with a few more alternatives Joomla offers by default an author name for the VM default page too. I use the developer Version 2.0.21H for my webpage. It seems to be very stable and fast. So you do not need to enter anything while defining VM menu items in Joomla inside the menu item creation fields, just the title. Then you go into VM configuration and enter your shop infos. You can even change the title here, if necessary.
Title: Re: Page Title Missing after upgrade to 2.0.20a - Expert needed
Post by: Milbo on July 09, 2013, 23:45:45 PM
How works this solution for you ?

if ($menu){
$menuTitle = $menu->params->get('page_title');
if(empty($menuTitle)) {
$menuTitle = JText::sprintf('COM_VIRTUEMART_HOME',$vendor->vendor_store_name);
}
$document->setTitle($menuTitle);
} else {
$title = JText::sprintf('COM_VIRTUEMART_HOME',$vendor->vendor_store_name);
$document->setTitle($title);
}
Title: Re: Page Title Missing after upgrade to 2.0.20a - Expert needed
Post by: namangarg88 on July 27, 2013, 20:29:02 PM
Hi everyone
I am also facing the same problem.
I tried to upgrade virtuemart version to 2.0.22a but updating using live update failed and throws an error "Invalid Token, in store config".
I even tried to dig out the code of view.html.php file at components>com_virtuemart>views>category.
Changed the code from :

// Set the titles
      if (!empty($category->customtitle)) {
              $title = strip_tags($category->customtitle).'1';
             } elseif (!empty($category->category_name)) {
         $title = strip_tags($category->category_name);
      }
      else {
         $title = $this->setTitleByJMenu($app);
      }


// Set the titles
      if (!empty($category->customtitle)) {
              $title = strip_tags($category->customtitle).'1';
             } elseif (!empty($category->category_name)) {
      //   $title = strip_tags($category->category_name);
      }
      else {
         $title = $this->setTitleByJMenu($app);
      }


What I observed was, while browsing to any category page, while loading the page first time, there is no title but refreshing the same page displays the required title.


Please help me in figuring out the problem.
Title: Re: Page Title Missing after upgrade to 2.0.20a - Expert needed
Post by: lindapowers on July 28, 2013, 08:05:52 AM
There seems to be a little confusion here, this topic is talking about the VM HOMEPAGE of your shop. The main page title for your shop which by default said "welcome to shopname".

Current version 2.022a solved this issue and now the meta title available in the config is being read so you can define your own title, for me it works fine same as the categories where you can also define the meta title.

Regards