Comments

pieterdc’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev

@New_bee: version 7.x-2.x-dev does this by default, I guess. Can you check?

I got an extra question: how can I make sorting language-independent?
I have a list of Hotels in French, sorted with draggableviews.
I want the English translated versions of those French hotels to be sorted the same way, automatically.
But draggable views saves the entity_id, not the tnid or something like that.

Any hint is welcome!

ygerasimov’s picture

This is quite interesting idea. I think we can have some hook after weight is saved to database. In this case we would be able to check if the node has translations and save translation's weight as well. @PieterDC what do you like such idea?

pieterdc’s picture

Category: support » feature
Status: Active » Needs work
StatusFileSize
new1018 bytes
new2.54 KB

The attached patch gives an extra option 'Synchronize translations' below 'Use ajax in draggable form.' at the Draggableviews views handler screen.
It works but it needs some polishing because it currently:

  • only works on nodes, not all entities
  • doesn't filter out language parameters, nor exposed filters, when set to sync translations. which could provoke unexpected behaviour
ygerasimov’s picture

Status: Needs work » Fixed

I think issue is quite site specific. Maybe someone would like to have more custom logic about translations.

There is hook introduced hook_draggableviews_handler_native_arguments_alter, that can alter set of saved records to database. There you can add your translation nodes and their weights to the list.

Commit http://drupalcode.org/project/draggableviews.git/commit/e50212c

Status: Fixed » Closed (fixed)

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

moniuch’s picture

I have an issue that seems to be related to this one. I'd be interested in applying the path #3 to the current dev build. I searched manually for various strings and and the patches seem to stay far away from the build. Any info how to add i18n to draggableviews, please?

llribas’s picture

Status: Closed (fixed) » Needs work

I think the option to keep synced the draggable views order throught translations it's a really good improvement for the module.
The solution proposed in #3 by PieterDC seem's really good, if it's technically feasible.

I would use this option if it exists!, avoiding the need for users to order each list for each language (when the order must be the same for every language).

:)

drupalok’s picture

possible solution that works for me:
use a field as storage for the order and synchronize the field values

moniuch’s picture

Sorry @drupalok, but if I were to use a separate field as an order value storage, I would have bothered installing DraggableViews at all. It's about making life easier.

m1r1k’s picture

Lets add PieterDC's patch as an example of using hook_draggableviews_handler_native_arguments_alter() to finally resolve this issue:

m1r1k’s picture

Sorry, this one works:

m1r1k’s picture

Status: Needs work » Needs review

Sorry, this one works:

mrupsidown’s picture

Issue summary: View changes

@m1r1k Excellent! Just what I needed. Thank you.

matthieu_collet’s picture

Does #11 still work with Draggableviews 7.x-2.1 ?
Seems not on my site

istryker’s picture

By reading this issue, it looks like it should work. If it does not then it might be a bug.

bhavanir’s picture

Is there a patch available for language support for the version 2.1.4 ?