Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
I'm probably overlooking it somewhere in the documentation, but is there a way of displaying - for example - entries in a given folder only dating from the current day and later?

Just as an example, something like: http://example.com/news.php?f=418&d=20141119

And, if that's the case, then why is this code not working?

Code: Select all
<cms:else_if k_nestedpage_name='library-events' />
      <cms:set events_id = k_nestedpage_id 'global' />
      <li><a href="<cms:show k_menu_link />"><b><cms:show k_menu_title /></b></a>
   <cms:else_if k_nestedpage_parent_id='events_id' />
      <cms:set current_date = "<cms:date format='Ymd' />" 'global' />
           <cms:set new_querystring = "<cms:concat 'd=' current_date />" />
      <li><a href="<cms:add_querystring k_menu_link new_querystring />"><b><cms:show k_menu_title /></b></a>


ETA: I confirmed that the combined view works, so that narrows it down to why the code isn't working to create the combined view.
Hi slink,

I think you'll find the following thread useful - "Show pages that fall within a specified time period" (viewtopic.php?f=8&t=8316).

We cannot combine views in the sense that a view cannot be both 'folder' and 'archive' at the same time *but* that is Couch's own perspective - we can always add our own logic in any view.

For example, in our case the view would be folder-view (as reported by Couch when it sees the 'f' param in querystring). We'll then get the 'd' param ourselves and feed the calculated dates into the cms:pages tag.

This way the cms:pages tag will have both the 'folder' param as well as the 'start_on' and 'stop_before'.

Hope this helps.
Thanks, kk! That solved things very elegantly.
3 posts Page 1 of 1