Problems, need help? Have a tip or advice? Post it here.
14 posts Page 2 of 2
Ok. Your use of 'ANY' made me think you were using relations ('ANY" works only for relation fields).

For normal fields, I think the following should work to skip empty values -
Code: Select all
<cms:pages masterpage="catalog.php" custom_field="ref_title!==" >

The op used is !== with nothing following it.

Does this help?
This works, indeed.

Your previous request was not understood fully.
See, I have 2 test pages, each with relation (has='one') and the same values to system page_titles. Relation is selected manually in admin with the same page on the other template.
<cms:pages masterpage="catalog.php" aggregate_by='ref_title'>
<cms:show k_page_title />
</cms:pages>

It works and shows both pages, with same titles. I guess, this is ok.
cms:pages shows only pages, that have ref_title relation. No matter what title they have.
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
Another take, now with regular couch.
bye, php :twisted:

Code: Select all
<cms:pages>
<cms:set counter='0' />

   <cms:each msg >
         <cms:if k_page_title=item >
             <cms:incr counter />
         </cms:if>
   </cms:each>

   <cms:if counter eq '0' >
            <cms:if msg!=''>
                   <cms:set msg="<cms:concat msg '|' k_page_title />" 'global' />
          <cms:else /><!--first run -->
             <cms:set msg=k_page_title 'global' />
          </cms:if>   
   </cms:if>

</cms:pages>
<h1>Titles without duplication:</h1>
<cms:show msg />


Nice!!
Bravo, trendoman
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
Also while working with csv import module, it is needed to store only unique content in new pages.
So this should prevent duplication, but doesn't work! :oops:
Code: Select all
<cms:csv_reader ...parameters skipped...>
<cms:set var=my_col_6 'global' />
<cms:pages masterpage='colordb.php' page_title=var >
   <cms:no_results>
            <!-- no pages found with this color, let's create one -->
      <cms:db_persist  _auto_title = '0' _masterpage = 'colordb.php'  _mode = 'create'
                  k_page_title=var >
      <cms:if k_error><strong style="color:red;">ERROR:</strong> <cms:show k_error/></cms:if>
      </cms:db_persist>
   </cms:no_results>
</cms:pages>
</cms:csv_reader>

What can be the problem?
PS Pages tag iterates and misses fresh-created pages. Looks like there is some cache or buffer.

Edit: show_future_entries = '1' in cms:pages solves it
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
14 posts Page 2 of 2