Hi everybody and a Happy New Year for all of you, Couch lovers !
I was missing from the forum in the last few years, as I was working on stuff which implyed only known things from Couch CMS.
I'm in the same situation now, but just found out that one of my data filtering setups that works in snippets it's not working in a non-clonable template which is used to display data from a clonable template.
As I remember, few years back, KK was the one who helped me out with the code, but somehow I just didn't found the post
This is my code which basically filters data by year (from publish date):
As I'm not inside a clonable template, I changed this line
to this one:
but have no idea how to change the first 7 rows of the code, in order to make it to work.
Any help is appreciated.
I was missing from the forum in the last few years, as I was working on stuff which implyed only known things from Couch CMS.
I'm in the same situation now, but just found out that one of my data filtering setups that works in snippets it's not working in a non-clonable template which is used to display data from a clonable template.
As I remember, few years back, KK was the one who helped me out with the code, but somehow I just didn't found the post
This is my code which basically filters data by year (from publish date):
- Code: Select all
<cms:if "<cms:gpc 'year' method='get'/>">
<cms:set year = "<cms:gpc 'year' method='get'/>"/>
<cms:set year_next = "<cms:add year '1'/>"/>
<cms:else/>
<cms:set year = ''/>
<cms:set year_next = ''/>
</cms:if>
<form method="get" action="">
<select name="year" onChange="this.form.submit();">
<option value="">------- Select year -------</option>
<cms:archives type='yearly'>
<cms:set archive_year = "<cms:date k_archive_date format='Y'/>"/>
<option value="<cms:show archive_year/>"<cms:if archive_year == year> selected="true"</cms:if>><cms:show archive_year/></option>
</cms:archives>
</select>
<noscript>
<input type="submit" value="Filter">
</noscript>
</form>
<cms:pages masterpage='public/docs.php' start_on=year stop_before=year_next order='asc' >
........
........
</cms:pages>
As I'm not inside a clonable template, I changed this line
- Code: Select all
<cms:archives type='yearly'>
to this one:
- Code: Select all
<cms:archives masterpage='public/docs.php' type='yearly'>
but have no idea how to change the first 7 rows of the code, in order to make it to work.
Any help is appreciated.