How can we build language wise draggable views, i mean need to save order based on language.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | draggableviews-sync_language_in_module-1368458-11.patch | 1.05 KB | m1r1k |
| #11 | interdiff.txt | 365 bytes | m1r1k |
| #10 | draggableviews-sync_language_in_module-1368458-10.patch | 1.02 KB | m1r1k |
| #3 | draggableviews-sync_language_in_module-1368458-2.patch | 2.54 KB | pieterdc |
| #3 | draggableviews-sync_language_in_handler-1368458-2.patch | 1018 bytes | pieterdc |
Comments
Comment #1
pieterdc@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!
Comment #2
ygerasimov commentedThis 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?
Comment #3
pieterdcThe 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:
Comment #4
ygerasimov commentedI 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
Comment #6
moniuch commentedI 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?
Comment #7
llribas commentedI 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).
:)
Comment #8
drupalok commentedpossible solution that works for me:
use a field as storage for the order and synchronize the field values
Comment #9
moniuch commentedSorry @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.
Comment #10
m1r1k commentedLets add PieterDC's patch as an example of using hook_draggableviews_handler_native_arguments_alter() to finally resolve this issue:
Comment #11
m1r1k commentedSorry, this one works:
Comment #12
m1r1k commentedSorry, this one works:
Comment #14
mrupsidown@m1r1k Excellent! Just what I needed. Thank you.
Comment #15
matthieu_collet commentedDoes #11 still work with Draggableviews 7.x-2.1 ?
Seems not on my site
Comment #16
istryker commentedBy reading this issue, it looks like it should work. If it does not then it might be a bug.
Comment #17
bhavanir commentedIs there a patch available for language support for the version 2.1.4 ?