2

I have a site with two languages and a large number of taxonomy terms. I want to use breadcrumbs on my taxonomy pages, but I can't find a system that works well with multiple languages.

I translated my taxonomy terms with the Entity Translation module, using the field method. What can I do?

0

You can do this by making a content pane in Views. Here's what you need to do.

  1. For hierarchical taxonomies, determine the maximum depth. Example: United States -> Illinois -> Chicago (child, parent, and grandparent)

  2. Create a view showing fields of taxonomy terms. Add a contextual filter: Taxonomy term: Term ID. For When the filter value is NOT available, choose Provide default value of Taxonomy term ID from URL and leave Load default filter from term page checked.

  3. Add a relationship of Taxonomy term: parent term. Do this as many times as you need to get to the maximum possible depth. Do not require the relationship because the term may be a root term. To make sure that you can keep track of all the relationships even though they will be of the same type, when adding the relationship, click More at the bottom of the add dialog and type in an appropriate name (parent, grandparent, great-grandparent, etc.) for the Administrative title.

  4. Add the taxonomy term name field (the one provided by the Title module, since we are using Entity translation). Don't use a relationship. As the administrative title, set "current page term" or something easy to remember.

  5. Now to get the parent and grandparent terms. First, add a term id for each relationship (parent, grandparent, etc.) Make sure to uncheck create a label and check Exclude from display. Make sure to set the proper relationship for each tid.

  6. Then, add the taxonomy term name field again as many times as necessary so that you have a name field for each relationship. Again, make sure to set the relationship each time you add a new field. Also, for each term name that has a relationship, make sure that Hide rewriting if empty is checked under No results behavior. Under Rewrite results, check Output this field as a link and enter taxonomy/term/[tid] where [tid] is the replacement pattern for the appropriate relationship.

  7. Reorder the fields from "oldest" (grandparent) to "youngest" (current term).

  8. Under Format, click Settings next to Fields. Check the boxes next to all of the non-tid fields to make them inline fields. Add the separator of your choice and you're done!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.