Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Hello again,
I have just change from "General Discussion" to here, guess this trouble I have now, fits here better...

I have placed links for archives of the blog on a snippet page that figures as a menu, that is embedded both in the page-view and in the list-view for my blog....But links do not work....As far as I can see, when I click i do get the folder-view, but posts appear just the same as they do when I call the list-view in a descending order
here is the code I wrote:

Code: Select all
<cms:if k_template_name=='mytemplatename.php'> 
                 <div class="archives"><strong>Blogarchive</strong><br />
        <cms:archives masterpage='mytemplatename.php' type='yearly'>
    <a href="<cms:show k_archive_link/>"><cms:date k_archive_date format='Y' /></a>
    (<cms:show k_archive_count />)<br>
</cms:archives>
      </div>
</cms:if>


thanks in advance again

Tanja
Hi Tanja,

The links generated by the 'archive' tag will only invoke your template providing it with querystring parameters specifying the selected archive period (the so-called 'archive-view').

It is now upon your code within the template how to (or not to) make use of the parameters.
Please take a quick loot at our documentation explaining hpw to list pages: http://www.couchcms.com/docs/concepts/l ... pages.html.
Following is the 'unified' way recommended there -
Code: Select all
<cms:if k_is_list >
    <cms:pages folder=k_folder_name include_subfolders='1' start_on=k_archive_date stop_before=k_next_archive_date >
        <!-- All the variables of each page belonging to this view are available here -->
    </cms:pages> 
</cms:if>

Notice in the snippet above how we are making use of the 'start_on' and 'stop_before' parameters to make the 'pages' tag list pages from only a specified time period - in effect creating an archive.

Hope this helps.
Thank you so much!!!!!

all works now, I `ve just needed to add those two lines in the list view within pages tag....

Best regards

Tanja
3 posts Page 1 of 1