Coded something up in Couch in an interesting way? Have a snippet or shortcode to share? Post it here for the community to benefit.
14 posts Page 1 of 2
Hello!

In the back end of the gallery (made with gallery='1' ), there is an option to move images left or right - to change their order in this way.

But it often happens that there are too many photos ... it's rather difficult to put them in their places using these buttons.
I could not find this issue in the forum. So please, if anyone knows how to simplify the sorting of images in the gallery, could you share this with me?

It would be just perfect to do it with a drag-and-drop =)

Thank you.
Well .. :| really not any solutions?
Jiwa wrote: Well .. :| really not any solutions?

It is an interesting task, but I never heard of anyone stepping into actually implementing it. It can be done via modding gallery theme's snippets. I think Dragula JS library could be used (or jQuery UI Sortable component).
I am glad to have this finally sorted out :) Thanks to @Jiwa for the substantial financial motivation towards this feature :D
Folks, check out this short screencast - [old link removed]

Addon moved to GitHub.

Visit Tweakus-Dilectus » Reorderable gallery (drag & drop) to see the demo and install instructions.
Simple & useful, like couch itself, nice work!
@trendoman, nice work :)
Any chance of the mod being released to public?
Sort images in the gallery with drag-and-drop, which works like a clock.

@Trendoman made it possible! :D

To see how this works (only for CouchCMS v2.1+):

1. Download the attached zip. Unpack the archive into "orderable_gallery" folder
2. Place this folder in 'couch\theme' folder
3. Edit 'couch/config.php' , add the following line to it (in paragraph number 26):

Code: Select all
define( 'K_ADMIN_THEME', 'orderable_gallery' );

Enjoy :P

Many thanks to @Trendoman =)

theme-orderable_gallery.zip
(29.81 KiB) Downloaded 936 times
Thanks for sharing :)
Moving this thread to 'Tips and Tricks'.
@Jiwa & @trendoman - thanks for this, really lovely.

have noticed that when on smaller screens when the row_actions is rendered as a button with popup options, the popup doesn't work. hope that makes sense.
I'm using 2.2beta.

cheers,
gwil
@Gwil, thanks for the heads-up.
What happens is a little conflict. Everything works fine after disabling drag on that particular link that appears only for smaller screens. Please make the following change in content_list_inner_gallery.html:
Code: Select all
invalid: function (el, handle) {
   return handle.className === 'btn btn-actions'; // exclude the action button
},
14 posts Page 1 of 2