News:

Support the VirtueMart project and become a member

Main Menu

Breadcrumbs issues

Started by doorknob, September 23, 2008, 01:36:57 AM

Previous topic - Next topic

doorknob

VM has its own breadrumbs maintenance class but it is not used in some cases. This goes unnoticed if you only publish the regular Joomla breadcrumbs. In html/shop.cart, html/shop.savedcart and html/shop.search, code like:
$mainframe->appendPathWay( $VM_LANG->_('PHPSHOP_ADVANCED_SEARCH') );

should be replaced with code like:
$pathway = array( $vm_mainframe->vmPathwayItem( $VM_LANG->_('PHPSHOP_ADVANCED_SEARCH') ) );
$vm_mainframe->vmAppendPathway( $pathway );


Phil
tested with the nightly download from 16/9/2008 (J1.5 version)

fire2

Hi doorknob,

First, thankyou very much for this code. I tried using it and I have no problems browsing through the store category menues but I am still facing two issues:
1. The breadcrumbs/pathway is wrong when I click on Account Maintaince link from the VM login module. It shows a product category that shouldn't be there, because the Account Maintainance is not under a product category. You can see it better in the screengrab.

2. When I search for a product i'm still having this issue (the product category shows under a wrong category, strange enough, the first category I created in VM). You can see it more clear in the screengrab. My product "Wanted - Trail workers" is only under Freepapers, not under Intertribal News, that is another category.

Do you know how to fix this? Which files should I change? I thought changing shop.search should have fixed the search results issue but it didn't. Anyone has any idea? I am facing this issue in several VM installations on different websites.

Thanks in advance.

[attachment deleted by admin]

[attachment cleanup by admin]
currently using:
Joomla 2.5.8
VM 2.0.14

doorknob

Maintenance of the breadcrumbs is a mess in VM. Normally, Joomla automatically maintains the breadcrumbs using the structure of menu items. VM categories don't have menu items because VM uses a module to simulate a menu instead of creating a proper menu. Joomla doesn't understand this and so to get breadcrumbs that mirror the product structure, VM creates its own to supplement the one produced by Joomla.

Beacause none of the features of VM have their own menu items, VM fools Joomla into producing breadcrumbs for the VM home page by including "&Itemid=nn" (where nn is the menu item id of the VM home page) in the URL of every link. Every VM program then calls a function to customise the breadcrumbs by adding extra text (either the product structure or miscellaneous functions such as account maintenance).

If you use a real menu item to call a VM page then the URL must also include "&Itemid=nn" so that the VM functionality works correctly. Expect problems with other components such as site maps because they don't always play ball with this non-standard approach.

The huge downside to the VM approach to breadcrumb maintenance is that every page of your VM site is considered to be the VM home page by Joomla, even if you set up real menu items for any of the pages. That means that modules can only be enabled for every page within VM or none, even for any features that you might have created real menu items for. For me that's way too big a sacrifice of valuable functionality and so I disable the vmAppendPathway() function in any program that I call from a menu item. Any link to a VM program from within a module like the login module must include 'Itemid=' for the VM way of managing breadcrumbs to work properly. If you get parts of the breadcrumbs duplicated or missing, it it almost always because 'Itemid=' is missing or has the wrong value.

I also use real menu items for my product structure instead of the VM module (a couple of minutes more setup, vastly superior functionality). At the moment, I still use the 'Itemid=' technique in the product related menu items but I'm currently looking at the feasibility of completely disabling the entire VM breadcrumbs feature so that I can get proper control over all of my menu items, including the product related ones. It would be very helpful if v1.2 had a switch to disable that feature for users that want to use real menus and make full use of the Joomla control mechanism.
Phil

fire2

Hi Phil,
  Thankyou very much for your answer, I think I understand it. But, how can I add the "Itemid=" to the "Account Maintainance" link, for instance? Where should I add it?

Thanks.
Yosia
currently using:
Joomla 2.5.8
VM 2.0.14

doorknob

#4
Yosia,
I've been in the habit of using the 'external link' type of menu item where you can make the url anything you like. If you do that, you must include 'Itemid=xx'. Your posting coincided with me starting to investigate this issue in more depth because I want to use the Joomla control facilities to manage modules in individual menu items. What I have found is:
1 If you use the 'VirtueMart' menu item type, VM does use the id assigned to that item by Joomla and not the one assigned to the vm home page. This causes duplication of the breadcrumbs. I'll be posting a proposed solution in a new posting when I've changed and tested my own code.
2 VM doesn't use the vm 'home' page as the basis for the breadcrumbs as I stated earlier. It only appears to do so. It just uses the first vm menu item it comes across in the menu table. Usually this will be the home page but may not be. If the home page is deleted and recreated, vm will start using a different menu item as the basis for breadcrumbs. That could cause an issue. I'm about to make a separate post about that with a proposed solution.

Regards
Phil

fire2

#5
Hi Phil,
 Thankyou very much, I understand everything you wrote. All my vm links are joomla menu links I created directing to the category/product id. For instance, I created an external link to "Account Maintainance" and it did fix the breadcrumbs issue, but now when I click on "Shipping Information" or "Billing Information, Orders" the url switches back to having an Itemid=XX (which is the first category I created in VM) and when I delete it from the URL the breadcrumbs appear as they should. So, do you know how can I change the code of "Account Maintaince" page so when I click on these links the URL doesn't get that "&Itemid=XX" [THIS IS SOLVED AS MENTIONED IN THE NEXT POST]

And, do you know what can I do so I don't get the wrong breadcrumb/pathway in the search results? How can I change that "Itemid=XX? Thankyou so very much for your help. I really appreciate it. Please post the link to your new topic about this issue and your solution whenever you start it.

I look forward to reading it!
Yoshiyah
currently using:
Joomla 2.5.8
VM 2.0.14

fire2

Hi Phil,
  I read your new posts on http://forum.virtuemart.net/index.php?topic=56515.0 and http://forum.virtuemart.net/index.php?topic=56514.0 and they are very helpful! I applied the changes you proposed on both and the breadcrumbs are working fine, but now the last menu item is duplicating on the Joomla breadcrumbs/pathway and so I see:
Home: Online Store: Books: Books

The proposed changes did not fix the search results problem either.

How can I fix this? As far as the "Account Maintainance" Link I created an external link pointing to "index.php?page=account.index&option=com_virtuemart" and I added "&Itemid=1" and the breadcrumbs is now showing up right. When I click on "Account Information, Shipping Information" or "View Orders" the breadcrumbs is now displaying properly, no wrong or duplicated categories. I don't really know technically why this is working but with the &Itemid=1 it is displaying right.

Thankyou so much for digging into this. I've been looking for a fix for a long time and never found it. I hope it is included in VM 1.1.2.

Regards,
Yoshiyah
currently using:
Joomla 2.5.8
VM 2.0.14

doorknob

Yoshiyah,
Take a look at my most recent post with a proposed fix for ps_session. This is designed to change the way that vm locates matching menu items so tha the correct Itemid gets assigned.
Regards
Phil