Thanks for this great module!
It worked well until I tried to make my site bilingual. After enabling i18n_taxonomy the default drupal taxonomy page is shown instead of the configured views. If I disable i18n_taxonomy taxonomy_display works the way it is supposed to. The vocabularies which are using taxonomy display with taxonomy menu have no multilingual settings. On three other vocabularies I chose the localize option.

I hope this isn't a duplicate of #1154410: Disable all other /taxonomy/term/% references? because I don't know if i18n_taxnomy overwrites taxonomy/term/%. But if it is - does that mean that I have to choose between the two modules or is there another way.

Comments

codycraven’s picture

pauleb,

I'm glad you enjoy the module. I took a look at i18n's implementation for i18n_taxonomy and they have this code:

/**
 * Implements hook_menu_alter().
 *
 * Take over the taxonomy pages
 */
function i18n_taxonomy_menu_alter(&$items) {
  // If ctool's page manager is active for the path skip this modules override.
  // Also views module takes over this page so this won't work if views enabled.
  if (variable_get('page_manager_term_view_disabled', TRUE)) {
    // Taxonomy term page. Localize terms.
    $items['taxonomy/term/%taxonomy_term']['page callback'] = 'i18n_taxonomy_term_page';
    $items['taxonomy/term/%taxonomy_term']['title callback'] = 'i18n_taxonomy_term_name';
    $items['taxonomy/term/%taxonomy_term']['file'] = 'i18n_taxonomy.pages.inc';
    $items['taxonomy/term/%taxonomy_term']['module'] = 'i18n_taxonomy';
  }

I then looked at i18n_taxonomy_term_page() and it looks like the only reason they are hijacking the term page is to provide a custom breadcrumb generation.

Based on this, if the i18n module maintainers are open to it, I can add support for breadcrumb hooking within taxonomy_display which would allow i18n to create a taxonomy_display plugin for providing the custom breadcrumb. They would need to add a check to i18n_taxonomy_menu_alter() to not hook taxonomy/term/%taxonomy_term if the taxonomy_display module is enabled along with creating the taxonomy_display plugin.

As soon as I get some time I will add support for the breadcrumb plugin and I can also roll a patch against i18n to accomplish the tasks outlined above, it would require them to implement the patch in to the module though.

So at this time these modules are currently unable to work together, however there is hope to make it work, it will just require some work and collaboration.

[EDIT] The i18n_taxonomy_term_page() also calls a function to perform altering of the term object within taxonomy/term/%taxonomy_term - I'll expose the object to a drupal_alter so that implementing modules can manipulate it without needing to overwrite taxonomy/term/%taxonomy_term. #1237136: Expose term object on term page to altering.

pauleb’s picture

That's what I call response time! Whow!
Thanks for looking into, and working on it!

codycraven’s picture

Work for expanding breadcrumb support, the last requirement for i18n's taxonomy sub module compatibility (an implementing patch will still need to be written/applied to i18n), is being performed in #1247802: Add breadcrumb plugin for taxonomy display..

mariusz.slonina’s picture

Please test #1280194: Taxonomy display integration. I created corresponding breadcrumb plugin and patches for i18n_taxonomy.

codycraven’s picture

Thank you for the initiative mariusz! I'll take a look when I get a chance, may be a day or two due to work load.

zambrey’s picture

Subscribing.

giorgosk’s picture

Seems that the linked issue and patch to i18n is stuck
since jose reyero wants patch to be applied to this module
what is the take on the module's maintainers

@mariusz.slonina
http://drupal.org/project/tvi is a module very similar to this one
TVI is not d7 ready but in d6 was working along side i18n
perhaps digging in this code one can find a way to overcome the i18n problem

mariusz.slonina’s picture

As far as I see in the TVi code, they just increase the weight to be larger than views, it has no internationalization code. I decided to use taxonomy_display, since it is far more stable than tvi, and this is critical right now for my current project, and I think this approach is much more D7-like.

If the i18n_taxonomy integration would go in taxonomy_display, we need to increase the module weight only -- the plugin for breadcrumb and proper term hook are ready, I think, I'm using it successfully.

On the other hand, taxonomy_display reimplements core taxonomy far better and more flexible than i18n_taxonomy itself. Such functionality should go into core, at least some useful hooks provided here, but that's separate issue.

codycraven’s picture

Just to note I'm attempting to work with the internationalization module maintainer to see the best way for us to create a long term compatibility between the module. If the patch works for the time being that is fantastic, I just want to ensure we do this in a collaboratively supported way before placing any specific code in a module release.

codycraven’s picture

Added a hook to alter core breadcrumb handler parents to make i18n manipulation more seamless.

codycraven’s picture

Assigned: Unassigned » codycraven
codycraven’s picture

Version: 7.x-1.0-beta1 » 7.x-1.x-dev
Component: Miscellaneous » Code
Category: support » feature
Status: Active » Needs review
StatusFileSize
new1.05 KB

Someone who knows about the i18n taxonomy module needs to test that taxonomy is now functional and works seamlessly with taxonomy display.

This will require using the latest dev version of 18n and either a git checkout of taxonomy display or using the dev package to be rebuilt on or after tomorrow, Friday, September 30th.

I have committed a patch in accordance with Jose's comment in the corresponding i18n issue -- attached here for review.

Also as a note, once this is marked RTBC I will release version 1.0.

jose reyero’s picture

The i18n part is already included in the latest release (7.x-1.1) so you can test with that version.

codycraven’s picture

Status: Needs review » Fixed
codycraven’s picture

Marking as fixed as this will be included in a patch today since i18n released with their compatibility yesterday. If any issues are found please re-open or post a new issue.

Status: Fixed » Closed (fixed)

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