Closed (fixed)
Project:
Custom Breadcrumbs
Version:
6.x-2.x-dev
Component:
custom_breadcrumbs_views
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
18 Sep 2009 at 18:00 UTC
Updated:
5 Oct 2009 at 14:40 UTC
Jump to comment: Most recent file
Comments
Comment #1
MGN commentedThanks for the report. Custom breadcrumbs views uses the views api function views_get_all_views() to get the list of views. It then filters this list to remove any disabled views and views that don't have a page display.
Apparently this is not sufficient to pick up on the hard coded views?
I thought views_get_all_views would do as the name suggests. Anyway, if anyone knows of another approach (via the views api) please let me know.
At this point its probably an omission since I haven't used hard coded views and no one else has mentioned a problem. Before we consider this a bug, we need to determine what is actually wrong with the current approach.
Comment #2
malc_b commentedI can confirm that views_get_all_views() doesn't return the hard coded ones. Perhaps this is really a views error? I guess the other way around is to use the custom breadcrumb by path.
What I'm trying to do is make the breadcrumbs consistent. What I currently get is:
Any page not in menu heirarchy (i.e. level1 or not in menu), BCrumb = Home
Any page in menu at level2, BCrumb = Home :: MenuLevel1
So reasonably sensible
A 1 level view to select taxonomy terms with pager, BCrumb = Home :: ViewTitle
Taxonomy term page, BCrumb = Home
A 2 level view (e.g. country, state) to select taxonomy terms with pager, 1st level BCrumb = Home
2nd level BCrumb = Home :: ViewTitle
Taxonomy term page, BCrumb = Home
This is wrong, the taxonomy page needs fixing to give a breadcrumb back to view and the single level view needs to lose the breadcrumb. Or I suppose every page could end with a self-reference on the breadcrumb to be consistent with the view. I can't find a way that works to remove the 1 level view breadcrumb so perhaps adding self-reference is the only workable option. I don't understand what gives that breadcrumb as it isn't a menu item doing it.
Comment #3
MGN commentedYou were right. Its a bug. And of course I do use hard coded views, I just hadn't heard the term before. See the attached patch. I think it should fix the problem.
Comment #4
MGN commentedOoops. Wrong patch. Try this one instead.
Comment #5
malc_b commentedThe patch works (for me). All my hard code views (do they have another name?, I just made that up) now appear on the custom breadcrumb set up form.
BTW there is another problem in that there aren't any views tokens, AFAIK, to make a useful custom breadcrumb. Say I decide to have my breadcrumbs as
Home :: Menu level 1 :: Title
That is to add the current page title, or for view the taxonomy term to the end of breadcrumb as either a link or plain text. For example take a country/state view. The top level title would be "Browse by country" and the url browse_by_country. If I then select usa then the url becomes browse_by_country/usa and the title becomes "Browse by country : USA". In that case I'd want a breadcrumb of
Home :: Browse by country :: USA
But how to get the USA as a token? It doesn't seem to be one AFAIK. BTW setting up the rest is not difficult. I just create 2 custom breadcrumbs for this single view and set the visibility based on the arg string. If arg(1) is true then the url browse_by_country/something
Comment #6
MGN commentedIf your view returns nodes, then the node tokens should work. Also, the global and user tokens always work. For views with taxonomy arguments, the taxonomy tokens will also work.
In your example, if USA is the top level term, then [term] (and related) will work. If your view takes taxonomy arguments then [cat] (and related) would work.
Other than that, you may need to develop your own tokens.
Thanks for testing. I hope this helps!
Comment #7
MGN commentedCommitted to 6.x-2.x-dev.
Comment #8
malc_b commentedThanks for the suggestions but neither [term] nor [cat] work. The way the view works is if there is no argument then all top level country terms are displayed. If there is an argument then only the sub terms below that are displayed. So on the second level you are still within the view, which now displays a list of terms. When you click one of those you go to the taxonomy page for that. So the way it works is:
Displays list of countries, Pick a country
Display list of states in that country, pick a state
Display nodes with that taxonomy term (the state), pick a node
Display node
The problem now is when I get to taxonomy page the breadcrumb should really be parent_term, term.
But I have found were views breadcrumb comes from. My views argument is taxonomy term and editing shows a breadcrumb override box and the info that if not overridden then the title is used.
Comment #9
malc_b commentedI had to add a custom token, return parent of term, in order to get the breadcrumb I wanted.