Hi there,

Thanks for thid module, I'll be relying heavily on it for the site I'm creating. I do have a problem though:

I have enabled the taxonomy_term view (comes with Views) and slightly edited it (field instead of nodes). I have a node type which always has two vocabularies assigned to it, one with one term and the other one with multiple tags.

I'm trying to get a custom breadcrumb for this view, but it doesn't seem to work. At first I thought I'd see if the Taxonomy Vocabulary page (in Custom breadcrumb) would recognize the view, but I don't think it does.

Next I created a Views page (in Custom breadcrumb) with [vocab] and [term] for titles (I didn't look into paths yet), but it always shows the same vocabulary and one term instead of reading the ones from the view.

What am I doing wrong here?

Thanks in advance!

Comments

MGN’s picture

Status: Active » Postponed (maintainer needs more info)

Do you have 'Use taxonomy breadcrumbs for views?' enabled on the custom breadcrumbs configuration page?

libeco’s picture

I didn't have it on, now I do have it ticked, but it doesn't seem to make a difference.

What I'm trying to do is have a breadcrumb for the taxonomy pages which looks like Vocabulary (which is a link to all terms in this vocabulary if possible) > Term (just text, no link). I'm using the View for taxonomy listings because it's easier to change the theme.

Thanks!

libeco’s picture

Actually, I think I've got it to work the way I want. Please tell me if this is the preferred method:

- I created a Custom Breadcrumb for Taxonomy Vocabulary.
- "Use the taxonomy hierarchy" setting disabled.
- "Use taxonomy breadcrumbs for views" setting enabled.
- Titles: Category and [cat] (I don't know if it's me, but I think [cat] sounds more like vocabulary then term)
- Paths: tags/category/ and
-> Still need to create a view to show all the terms in a vocabulary, but I assume that will be easy

So basically I didn't use placeholders for the vocabulary, meaning I have to create a custom breadcrumb for each vocabulary (luckily just two for me).

Thanks!

libeco’s picture

Nope, I spoke too soon. Although this does work for the taxonomy_term view, it also takes over another view's breadcrumb. Still in need of a solution.

Thanks!

MGN’s picture

Component: User interface » custom_breadcrumbs_taxonomy

Can you explain this further? From what you have said, I assume you assigned a custom breadcrumb for a view (using custom_breadcrumbs_views) which was working correctly, and then the breadcrumb changed when you enabled "use taxonomy breadcrumb from views?"

If this is the case, try changing the relative module weighting of custom_breadcrumbs_views so that it is heavier than custom_breadcrumbs_taxonomy. You can do this under the advanced configuration on the custom breadcrumb settings page. Just check the box (adjust module weights) and drag Custom Breadcrumbs Views so it is lower down on the list (heavier weight) than Custom Breadcrumbs for Taxonomy. Now, custom_breadcrumbs_taxonomy will not modify a breadcrumb that has been prepared by custom_breadcrumbs_views.

I just fixed a bug in the custom_breadcrumbs_taxonomy code that was preventing this from working. So be sure to upgrade to the latest 6.x-2.x-dev source (in cvs now, the tarball will be updated with the next nightly snapshot).

libeco’s picture

Actually I wrote view, but I just realised it's a normal Drupal breadcrumb.

I have a view which displays all the posts in a blog. I've set pathauto up to create URL's like this: 2009/08/24/title of the post. I've added arguments to the view so when trying 2009/08/ it will display all posts of August 2009. Drupal automatically shows a breadcrumb. I tried using custom breadcrumb to take over this view, but it won't work, because [yyyy] only works on a node display. So I don't use a custom breadcrumb for this view.

I have set up a taxonomy_vocabulary breadcrumb through the method mentioned earlier.

I tried the suggested weight change, but It did not change anything, probably because the breadcrumb for the view is a normal breadcrumb and not a custom one.

*edit*
Actually, the tickbox in front of change module weight refuses to stay ticked. And the order also resets every time.

MGN’s picture

(I don't know if it's me, but I think [cat] sounds more like vocabulary then term)

I think the [cat] token gives the term, not the vocabulary ([vocab] is used for that).

Drupal automatically shows a breadcrumb.

For the view? I know this is the case for a taxonomy term argument - there is an option to have views set the breadcrumb, but you can disable this. What does the breadcrumb look like? What kind of arguments are you using?

but it won't work, because [yyyy] only works on a node display

True. If you have defined a taxonomy custom breadcrumb, and the view uses taxonomy term id, term name or vocabulary id as an argument. But if the view doesn't use one of these taxonomy arguments then custom_breadcrumbs_taxonomy will load the first node that is returned by the view. In this case [yyyy] would work.

Of course you can always grab the year from the url using the arg tokens (patch is available at #273893: Argument tokens using arg()).

Actually, the tickbox in front of change module weight refuses to stay ticked. And the order also resets every time.

The tickbox is off by default. Just tick the box, change the module order and then hit save configuration and the change should take effect (even though the tickbox will reset to off).

So after all this I am confused about what you are trying to do again!

First, you indicated that you were trying to get a breadcrumb for the taxonomy term view (which would take a taxonomy term argument). But then you have also said that that you have a view which displays all the posts in a blog (and this view appears to use node-created year and month arguments).

So are we still talking about the same view, or are these different views? Can you better describe the type of views arguments you are using, and what you want the breadcrumb to look like?

libeco’s picture

Ok, sorry for the confusion. :-)

First:
- To me [cat] sounds like the wrong token for a term, that's why I mentioned it.
- When ticking the box and re-arranging it does save the setting indeed.

I have a blog with paths set up to be "blog/2009/08/02/title". I have set up a view called blog which has a path of blog.
It has these arguments:
- Node created year with title set to %1 and 'Action to take if argument is not present' set to 'Summary, sorted ascending'.
- Node created month with title set to %2 and 'Action to take if argument is not present' set to 'Summary, sorted ascending'.

Because of the set up paths I can type something like blog/2009/08/ to see all the posts made in August 2009. But it's also possible to use blog/2009/ to view all months with posts in 2009. Without the taxonomy breadcrumb the breadcrumb would display: Blog archive (Name of the view) > 2009. While this is not the ideal breadcrumb for me, this was not my support request, although it would be great if there was a solution for it. The ideal breadcrumb for this view would be 2009 > August for all the posts made in August 2009, while also displaying 2009 when viewing the months with posts in 2009.

The other view is the taxonomy view as provided by Views. I didn't change anything for the arguments, just the fields to display, but I don't think this will have any effect on the breadcrumb, will it? Ideally the breadcrumb for the taxonomy listing would look like Vovabulary > Term.

I hope I've made it more clear with this post, if not, please let me know.

Thanks again!

MGN’s picture

Yes, I suppose [cat] is a strange name, and category is vague, but I assume there is some history behind it and its here to stay...

As I understand it, you are not trying to setup a custom breadcrumb for a specific term or vocabulary, so you can use a custom_breadcrumbs_views breadcrumb for your taxonomy view.

The view path taxonomy/term/% should be listed on the create custom breadcrumb for views form, so select it. The custom breadcrumb should be setup as something like

Titles:
[vocab]
[cat]

Paths:
path/to/vocabulary/view
<none>

where path/to/vocabulary/view is the path for your vocabulary view (which you'll need to create to list all the terms in the vocabulary.

Similarly for your blog view, to get 2009 > August you could use a custom_breadcrumbs_views breadcrumb

Titles:
[yyyy]
[month]

Paths:
blog/[yyyy]
blog/[yyyy]/[mm]

I've just committed some changes to the way custom breadcrumbs does token replacement with views that have arguments, so you might want to get the latest code (in cvs now...dev snapshot within the next day) if these suggestions don't work with your current code.

libeco’s picture

I've tried your solution before upgrading. In the taxonomy/term/% breadcrumb, [cat] is never replaced, it's just shown as [cat].

In the blog view a url like blog/2009/08 works well (although the last item in the breadcrumb is a link to the page itself) and shows 2009 > August, a url of blog/2009 however does not work well and shows [yyyy] › [month] without replacing anything.

After I upgraded to the latest dev (2009-Aug-28) the first problem is solved and the tag is shown properly. The last problem remains however. Do you have a solution for this?

Thanks again, your help is really appreciated!

MGN’s picture

Sorry for the delay in answering your question - I lost track of this issue. Can you tell me what the view returns when you access it through blog/2009 ? Is it a list of nodes, or somthing else? If its a list of nodes, then it should use the first returned node to determine the [yyyy] and [month] tokens.

Note that you might want to make a separate custom breadcrumb for the view when only the year is provided. In this case you could make a second breadcrumb for the view and control the breadcrumb visibility by a php snippet that checks the number of arguments in the url. If there are only two arguments, then just have a a single level breadcrumb displaying the year. The original breadcrumb would also have to use a php to control visibility to also show the month when its provided.

libeco’s picture

Hi there, thanks for not forgetting me!

The blog/2009 view shows a list of months in which posts are made. In case it is of any help, I have uploaded the installation with a mention the website is not finished yet. You can find it at drupalist.nl.

Thanks!

MGN’s picture

Ok, I finally got around to looking at the page. Since its a view and nodes are not being returned, the [yyyy] token won't work. I think the best way to get blog > 2009 is probably to use the arg tokens with the TokenSTARTER kit. There is a patch on the token issue queue that adds these tokens see the most recent patch in #273893: Argument tokens using arg(). Once you have enabled the patched version of token starter, you'll have access to the parts of the url through [argN], where N is an integer - [arg1] will return 2009 when the url is blog/2009.

So you can create a custom_breadcrumbs_views breadcrumb with

Titles:
Blog
[arg1]

Paths:
blog
blog/[arg1]

and that will give you the breadcrumb you are looking for. Hopefully someday the arg support patch will actually get committed...

libeco’s picture

Talk about dedication! Wow, this did the trick, combined with the post before!

I changed the tokenstarter code with the patch, used [arg1] and [month] as titles and blog/[arg1] and blog/[yyyy]/[mm] as paths.

This almost got me there, it just messed up the display per year, so I created another custom_breadcrumbs_views with the following PHP snippet:

 if (arg(2)) {
return false;
} else {
return true;
} 

... and [arg1] as title and blog/[arg1] as path.

Thank you very much for all the help, it's much appreciated! I'll also post in the other issue to confirm it works.

MGN’s picture

Status: Postponed (maintainer needs more info) » Fixed

Glad to hear we arrived at a solution.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Petr Illek’s picture

I have similar, maybe the same problem...

I´m bulding a catalog of companies (5000+ nodes), and categorize the with hierarchival taxonomy (450+ terms in 4 levels).
I´ve setup a view for the catalog, which is filtered via arguments (Term ID - with depth).
I have a block with all the taxonomy term, with its hierarchy.
I want to have this type of breadcrumbs Home > Vocabulary (linked to the base view without argument) > Term (linked) > Term (linked) > Term (linked) > Term (curent term, without link).
My biggest problem is the vocabulary part of the breadcrumb, because there is no link on it. The rest of the breadcrumb work as expected for first time.
I try to make a custom breadcumb for this view, but in this case I don´t know how to make the Term´s part of the breadcrumbs, because some nodes are in the two level taxonomy, some in the four level... And it is not suitable to make 450+ custom breadcrumbs for terms... :).

Can you tell me how to make the vocabulary linked?

MGN’s picture

The vocabulary portion of the breadcrumb will be linked if you create a vocabulary-type custom breadcrumb. From the custom breadcrumb list page, click on the 'vocabulary' tab. Select the vocabulary that you want to provide a link for, then fill in the link. That should do it.

Make sure you have enabled 'Use the taxonomy hierarchy to set the breadcrumb trail for nodes and taxonomy pages' and 'Show current taxonomy term in breadcrumb trail on the taxonomy term page'

Petr Illek’s picture

Oh, its really that easy!!
I've tried literally everthing, but apparently always in the wrong combination.
Thanks a lot.

hixster’s picture

Do you have 'Use taxonomy breadcrumbs for views?' enabled on the custom breadcrumbs configuration page?

I don't have this option in admin/build/custom_breadcrumbs?

jeff.maes’s picture

That's only available in v2