Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Hi,
I want to list only the root folders of a gallery, level 1, not the subfolders.

I must do something wrong, but I can't figure out why it doesn't work

<ul class="sub-menu">
<cms:pages masterpage='products.php' include_subfolders='0' >
<li><a href="<cms:show k_page_folderlink />"><cms:show k_page_foldertitle /></a></li>
</cms:pages>
</ul>

Thanks,
Paolo
Hi Paolo,

If it is the folders that you wish to list, I think the cms:folders tag (http://www.couchcms.com/docs/tags-reference/folders.html) is what you should be using. You can set the depth parameter to 1 to list only the root folders:
Code: Select all
<cms:folders depth='1' masterpage='products.php'>
    <li><a href="<cms:show k_folder_link/>"><cms:show k_folder_title/></a></li>
</cms:folders>
Hi cheesy, and thanks (again)

I just solved it with:
<cms:folders masterpage='products.php'>
<cms:pages masterpage='products.php' folder=k_folder_name limit='1'>
<li><a href="<cms:show k_page_folderlink />"><cms:show k_page_foldertitle /></a></li>
</cms:pages>
</cms:folders>

but your solution's better.

Guess I haven't sleep enough.

Cheers,
Paolo
3 posts Page 1 of 1