Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
For a Blog, I am using the dynamic folders (http://www.couchcms.com/docs/miscellane ... lders.html) to categorize blog posts in different groups.

On the sidebar of each blog post and and list view, that shows all available posts, I would like to show the available folders. The names and links are displaying correctly, however, the link always leads back to the general list view and shows all available posts. It does not filter the posts from only the selected category:

Code: Select all
           <h4>Categories</h4>

             <ul>
               <cms:folders masterpage='blog.php' folder=k_folder_name limit='4' paginate='1' >
                 <li><a href="<cms:show k_folder_link />"><cms:show k_folder_title /></a></li>
               </cms:folders>
             </ul>


Would appreciate your help how to correctly list the posts within each dynamic folder.

Secondly, is it possible to show the number of posts within each dynamic folder (e.g. Title (5) )?
Hi,

the link always leads back to the general list view and shows all available posts

If you have not implemented a dedicated view for the folder e.g. as follows -
Code: Select all
<cms:if k_is_folder>
   ...
</cms:if>

- a link to the folder will invoke the list-view (as you are seeing for yourself).

You should now make changes to the cms:pages code in the list view to take into account the folder too. This we do by using the 'folder' parameter as follows -
<cms:pages masterpage='blog.php' folder=k_folder_name limit='5' paginate='1' >
...
</cms:pages>

Secondly, is it possible to show the number of posts within each dynamic folder
As we saw above, we use the cms:pages tag to do the listing of pages within a folder. The 'limit' parameter can be used to constrain the number of pages being show (the code above uses this parameter).

Hope it helps.
Ok, got it now.

Simply added "<cms:pages masterpage='blog.php' folder=k_folder_name >" in the list view and it works.
3 posts Page 1 of 1