Forum for discussing general topics related to Couch.
5 posts Page 1 of 1
Hi there :)

Searched on forum, but no results yet.. Is there a tag or something to prevent executing other tags on page under a special condition, like a total 'break'?

Code: Select all
<cms:if k_is_folder>
   <cms:pages>
        <cms:no_results>
            <h1>Nothing to see here<h1>
            <cms:break /> <!-- end of executing of the whatever rest -->
        </cms:no_results>
   </cms:pages>
</cms:if>

I realized this can be done with embedding and <cms:ignore> or <cms:no_results>. But I am curious like I'm a teenager again :D
An example of my code to show nothing, when there is nothing to show :D
Code: Select all
   
   <cms:if k_is_folder >
      <cms:if k_folder_totalpagecount gt '0' >
         <cms:embed 'gallery.html' />
      <cms:else />
         <cms:embed 'empty.html' />
      </cms:if>
   </cms:if>
Hi :)

Under certain conditions, you may also find cms:abort very useful. This is somewhat akin to PHP die();
Code: Select all
<cms:if something_drastically_not_ok >
    <cms:abort />
</cms:if>

or
Code: Select all
<cms:if something_drastically_not_ok >
    <cms:abort>
       <h1>Any enclosed content would be outputted before killing off the current page</h1>
    </cms:abort>
</cms:if>
Great! Thank you :D
Could I put some effort too to get together all the additional tags in documentation?
Kinda crowdsourse, if there is some way to take part in it. :geek:
Could I put some effort too to get together all the additional tags in documentation?
Kinda crowdsourse, if there is some way to take part in it. :geek:
You are most welcome to :)
The entire documentation is at GitHub -
https://github.com/CouchCMS/Documentation
5 posts Page 1 of 1
cron