Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Ok, after looking around the documentation and the forum I couldn't find a solution to my problem, maybe I overlooked it, but the this is that I hope you can help me on this one.

So the doubt I'm having is in the listing view. In my project I have different cloned pages in folders. I have a list of this folders, and depending on the folder you click, you get the listing of cloned pages inside this folder, but some of this folders are empty, and I want to put a text in this case for example: Sorry!, We don't have any items in this category at the moment. So the deal is I need some sort of condition that will make me able to separate those folders with pages(where you get the list of pages inside this folder) , from those that do not have any pages in them and show the text I mentioned above.

Thank you very much!
Christian
I think I had the same problem, solution:
Code: Select all
         <cms:pages masterpage='whatever.php'>
            <cms:if "<cms:not_empty k_page_title />" >
               [include your stuff here]
               <cms:set pagecheck='1' 'global'/>
            </cms:if>
         </cms:pages>
         <cms:if pagecheck >
            <cms:else />
               Sorry, nothing to see!
            </cms:if>

You catch your page the usual way, then you check if k_page_title is empty (which it would be if there are none), if its not the stuff in if will be executed and pagecheck gets the value 1. If k_page_title comes up empty nothing will get displayed. Then pagecheck gets checked, if it has a value nothing happens, if not you get "nothing to see" displayed. Hope I could help.
..depending on the folder you click, you get the listing of cloned pages inside this folder, but some of this folders are empty,..

This is the 'folder view' that you are referring to.
Of the various variables made available by Couch in this view, the one that we can use is the 'k_folder_pagecount' variable that contains the number of pages the folder being viewed contains.
Code: Select all
<cms:if k_folder_pagecount='0' >
   Sorry!, We don't have any items in this category at the moment.
</cms:if>

Please refer to http://www.couchcms.com/docs/concepts/v ... views.html for a list of variables available in different views.

TIP: When searching for a variable that might be useful in a particular view, use the 'dump' or 'dump_all' tag to list all the available variables.
3 posts Page 1 of 1
cron