Forum for discussing general topics related to Couch.
4 posts Page 1 of 1
Hi. I have the following code in my file blog_sidebar.html, which is in the snippets folder

Code: Select all
    <h4>Archives</h4>
             <ul class="sidebar">
                <cms:archives masterpage="blog.php">
                <li><a href="<cms:show k_archives_link />"><cms:date k_archive_date format="F Y" /></a></li>
                </cms:archives>
             </ul>

When I view blog.php in my browser, it shows the heading Archives, and lists all the months underneath. The months are all clickable and appear to be links, but none of the links work

I have searched for the answer and seen this

Code: Select all
<cms:pages masterpage='blog.php' start_on=k_archive_date stop_before=k_next_archive_date paginate='1' limit='10'>

But I don't know if this is the right answer for me and if it is, where to add this code

Please can someone point me in the right direction.

And by "point me in the right direction", I mean please tell me exactly what to type and where. I'm hopeless

Thanks in advance

Joel
Hi,

I think the problem lies here -
<li><a href="<cms:show k_archives_link />"><cms:date k_archive_date format="F Y" /></a></li>

The correct variable is 'k_archive_link' (no 's' in there).
More info - https://docs.couchcms.com/concepts/using-archives.html

Hope this helps.
Hi

Thanks for your help. I changed it and it worked!

Thanks again
Is it possible to hide special folders from archives, like so:

Code: Select all
<ul class="sidebar">
                <cms:archives masterpage="blog.php" folder='NOT special_folder' >
                <li><a href="<cms:show k_archives_link />"><cms:date k_archive_date format="F Y" /></a></li>
                </cms:archives>
</ul>


or with exclude or is there any workaround?
4 posts Page 1 of 1