Coded something up in Couch in an interesting way? Have a snippet or shortcode to share? Post it here for the community to benefit.
17 posts Page 2 of 2
I see the gallery images have no way of sorting them, via this approach. This is correct? I use the gallery in another place, where I request the first image with "limit="1"", but that means I need to control, which is the first image.

It works fine otherwise, thank you.

I am using the CouchCMS version from the download page, since the GitHub version didn't work for me (got a data-bound-form error, can make a separate topic if needed).


I see the gallery images have no way of sorting them, via this approach. This is correct?

Actually there is. Please see -

the GitHub version didn't work for me (got a data-bound-form error, can make a separate topic if needed).

Yes, please do create a new topic for that.
It is unexpected for the GitHub version to not be backward compatible with the current version so I'll definitely want to take a look at your issue.
Hello @KK, would it be possible to separate uploaded images into folders of a gallery automatically? proposed solution is awesome, however I an encountered a small issue - if a user would delete the page without deleting images first, stray images would be kept. Would be easier to manage these images if they were separated into folders as well when viewing from the gallery template :)
Hello @Kulverstukas :)

While using a separate folder for each page's images would be useful, it'd still require deleting the images manually.
Also the pages can potentially run into hundreds of thousands in number - folders (like nested-pages) were not designed to scale to such large numbers.

A better solution would be to emulate what we have in database parlance "on delete, cascade" i.e. deleting the parent page should automatically delete the dependent gallery pages.

I do have this feature on my to-do list (though not among the items I need to immediately address).
Yeah, you are right about that one I suppose. That feature would be great and I can't wait for the next release of CouchCMS!
Have got a one page site set up with two sliders (soon to be more).
I've got seperate templates for two different regions that each have a slider. The editable regions are then displayed in index.php.
I've used your code above to create a slider.php (gallery.php in your example) and two non clonable templates, events.php & repairs.php.
If I use events.php as products.php from your example I am having difficulty displaying in the main index.php.

The following seems to work
Code: Select all
<cms:reverse_related_pages 'slider_events_img'
    masterpage='c/templates/slider.php' >
     <!-- All variables of 'gallery.php' are available here -->
     <li><img class="tns-lazy-img" src="" data-src="<cms:show gg_image />"
           alt="<cms:show k_folder_name />" title="<cms:show k_page_title />" />

I am trying to figure out how to create a new slider for repairs.php and only display its images.
I have tried to create a new editable in slider.php that points to repairs.php for masterpage and is named slider_repairs_img, but I keep getting all images shown.
ie. In the admin section I can upload images to events.php and repairs.php and it shows the correct number. When displayed using the above it displays all the images in slider.php.

I hope this makes sense. If any one can point me somewhere I'd be very grateful.

EDIT: To be clear, what i'm trying to do is have a single slider template which can be used in multiple places, automatically creating folders for each instance. At the moment it is for two sliders, but will be used for each blog entry also.
EDIT: All done in a one page site (ie index.php displaying editable regions from section templates)
Sorted this one myself eventually.
I wasn't creating unique editable for each area, nor wrapping with cms:pages correctly.
Works a charm now.
17 posts Page 2 of 2

Who is online

In total there are 4 users online :: 0 registered, 0 hidden and 4 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 4 guests