Important announcements from CouchCMS team
21 posts Page 2 of 3
Is there any way to have a conditional (if) statement that checks for the existence of data within a repeatable region?

i.e. I want to be able to have something like this:

Code: Select all
<cms:repeatable name="auction_lots" label="Auction Lots" >
   <cms:editable name="lot_title" type="text" label="Lot Title" />
   <cms:editable name="lot_description" type="nicedit" label="Lot Description" />
</cms:repeatable>

   ...

<cms:if 'auction_lots' >
   <section id="auction" class="auction">
      <h1>Auction</h1>
      <article>
         <cms:show_repeatable 'auction_lots' >
            <h2 class="lot-title"><cms:show lot_title /></h2>
            <div class="lot-description">
               <cms:show lot_description />
            </div>
         </cms:show_repeatable>
      </article>
   </section><!-- #auction -->
</cms:if>


Where the entire auction section is hidden if I've not populated the backend with lot information.

Thank you.
Code: Select all
<cms:capture into='auction_lots_repeatable' >
   <cms:show_repeatable 'auction_lots' >
      <cms:if lot_title && "<cms:not_empty lot_description />" >
         <h2 class="lot-title"><cms:show lot_title /></h2>
         <div class="lot-description">
            <cms:show lot_description />
         </div>
      </cms:if>
   </cms:show_repeatable>
</cms:capture>


<cms:if "<cms:not_empty auction_lots_repeatable />" >
   <section id="auction" class="auction">
      <h1>Auction</h1>
      <article>
         <cms:show auction_lots_repeatable />
      </article>
   </section><!-- #auction -->
</cms:if>
cheesypoof wrote:
Code: Select all
...

This looks like it could be a good solution - alas the spec of the project changed slightly, and as such, I on longer need this, but I'll keep it in mind for future projects.

Thank you
Still loving Couch 1.3, but where is Couch 1.4 ? It's been four months since the last release !
@nfwd
Some news of what is brewing up :)
viewtopic.php?f=8&t=7262&p=10076#p10076
If you release version 1.4 with a shopping cart, all my dreams will have come true :)
Do we have any news on with this will become a full release (rather than an RC?)
Do we have any news on with this will become a full release (rather than an RC?)

This weekend, hopefully, along with the release of the next version.
KK wrote: This weekend, hopefully, along with the release of the next version.


Looking forward to this. I'm just about to start a new project, so is it worth waiting for the next version?
The primary feature of the next version is the shopping cart. So if your project requires one, please wait for just a couple of days more. Else you can use the current version.
21 posts Page 2 of 3

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 1 guest