Problems, need help? Have a tip or advice? Post it here.
2 posts Page 1 of 1
In a list view displaying clonable pages I would like to show a message in the case that there are no data sets in the system or all data sets are unpublished.

Currently, I am using the following:

Code: Select all
<cms:if k_folder_pagecount='0' >
                <h2>There are currently no open positions.</h2>
</cms:if>


However, I have unpublished pages, so the condition k_folder_pagecount='0' is logically not met and nothing is displayed.

Is there a way to check if all clonable pages are unpublished?
You can use the cms:no_results tag to handle cases where cms:pages does not fetch any record
Code: Select all
<cms:pages ..>
   ...
   
   <cms:no_results>
      <h3>No pages found</h3>
   </cms:no_results>
</cms:pages>

In addition to cms:pages, the cms:no_results tag will work for cms:comments, cms:search, cms:related_pages, cms:reverse_related_pages & cms:query tags as well.

Hope it helps.
2 posts Page 1 of 1