Important announcements from CouchCMS team
8 posts Page 1 of 1
Hi,

The type 'relation' editable region, as we know, shows all the pages to choose from in a single list (or dropdown).

Normally that is fine but it can be a bit unwieldy to work with if the number of pages is large.

@orbital contacted me a few days back with this problem. - one of his templates had nearly 40,000 cloned pages and, not surprisingly, it was nearly impossible for the user to choose specific pages from a list that large.

As a solution, I made some changes to the existing 'relation' type adding a new way of selecting pages.
It requires only adding a new parameter to any existing relation field as follows -
<cms:editable
name='test_rel'
type='relation'
masterpage='movies.php'
advanced_gui='1'
/>

After visiting the template as super-admin for the change to persist, you'll find that the relation field now displays the pages in a popup window that has pagination, folders and search to make it easier to work with any number of pages.

Here is @orbital testing things out with nearly 20,000 pages (he has a very large number of folders as well so perhaps that would require some tweaking too :) )-
scr.gif
scr.gif (108.46 KiB) Viewed 691 times

If someone wishes to try it out, please download and use the latest version of Couch found at GitHub (https://github.com/CouchCMS/CouchCMS),

Do share your feedback.

Thanks.
Very useful work!
Thanks for this great work KK!

A small tip for those who will use this ... if possible use PHP 7 version because Couch works perfectly with it without any error or warning.

Thanks
Hi KK,

I see that orderby='page_name' order_dir='asc' no longer work,
Code: Select all
<cms:editable 
name='test_rel'
type='relation'
masterpage='movies.php'
advanced_gui='1'

orderby='page_name' order_dir='asc'

/>


But it would be good to be able to sort this way - orderby='page_name' order_dir='asc'.
Is this possible in the new advanced_gui='1'?

Can it also be turned off (disable) the third column of the modal window - page publish date?

Thank you
I would like to customize the modal window - for example, I would rename the 'Save' button to 'Add' button, because after clicking 'Save' I forgot to click 'Save' again on the page itself - so the newly added data was not saved.
for example, I would rename the 'Save' button to 'Add' button

Yes, I noticed that too. Will commit the change shortly.
orbital wrote: But it would be good to be able to sort this way - orderby='page_name' order_dir='asc'.
Is this possible in the new advanced_gui='1'?


Did you solve this? I also want to show pages sorted by title.
I see that orderby='page_name' order_dir='asc' no longer work,

Yes indeed that was an oversight on my part.
I have tried to rectify it now. Please get the modified addon (just one file actually - 'edit-relation.php') from GitHub https://github.com/CouchCMS/CouchCMS

@orbital, @trendoman
please test it and let me know if it does the job.

Hope it helps.
KK wrote: please test it and let me know if it does the job..

Thanks, after proposed change, advanced-gui list is sorted :) Also selection is sorted after page save and reload. Good job!
8 posts Page 1 of 1

Who is online

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

Users browsing this forum: No registered users and 2 guests