Problems, need help? Have a tip or advice? Post it here.
5 posts Page 1 of 1
Is there a way to get the last cloned page that had the editable region "find_me" and show only that one? I'm trying to achieve this knowing that on some cloned pages the "find_me" regions might be blank therefore it should be ignored.

Let's these cloned pages

4 - "find_me" is empty
3 - "find_me" is empty
2 - "find_me" has the value 7
1 - "find_me" has the value 9

How can I show work my way through the cloned pages so that I can show only the value of clone page nr. 2?
You want to filter out pages with empty find_me? Then find those that are not empty. You need to see this topic http://docs.couchcms.com/tags-reference ... stom_field and it should help. Once you understand how it works, apply this trick: use "find_me!==''" (2 single quotes inside double quoted expression). Tweaking 'orderby' parameter may also be helpful after filtering.
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
trendoman wrote: You want to filter out pages with empty find_me? Then find those that are not empty. You need to see this topic http://docs.couchcms.com/tags-reference ... stom_field and it should help. Once you understand how it works, apply this trick: use "find_me!==''" (2 single quotes inside double quoted expression). Tweaking 'orderby' parameter may also be helpful after filtering.


Code: Select all
<cms:pages masterpage="page.php" custom_field='find_me!==' limit='1'><cms:show find_me /></cms:pages>


Thank you once again! I forgot about custom fields since I didn't use them more than 2-3 times in the past...tsk,tsk,tsk.
Welcome :)
Code: Select all
'find_me!=='

Did it work this way? Cool, I will try next time :D
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
trendoman wrote: Welcome :)
Code: Select all
'find_me!=='

Did it work this way? Cool, I will try next time :D


Yes it does, I was thinking that by using double quotes to suggest empty space, couch would actually take the double quotes as characters since if not changed, couch ignores only the comma, therefore placing literally nothing must be taken as an empty space and it works like a charm.

Thank you !
5 posts Page 1 of 1