Forum for discussing general topics related to Couch.
12 posts Page 1 of 2
Hello All,

I have tried to search on here if anyone has asked this question but I could not get a feedback returned. I want to know if it is possible for one to click a parent folder and link to the child folders before linking to the page nested.

If possible how is that done.

Thank you.


Parentfolder (FolderView)
---ChildFolder (FolderView)(sub)
Please see the docs on folders at
Specifically, find the sections discussing <cms:parentfolders> and <cms:breadcrumbs>.

Hope it helps.
I have used the parentfolder tag, it's not enumerating the subfolders.

That's why I'm seeking help. May be I'm doing something wrongly. I'll post the code as soon as I get on to my PC.

Thanks KK
What I intended to achieve is to list parent folders on the home page. Then the parent folder links should direct one to the subfolders, say on a product template section, which then links to the pages within.

Am I too ambitious?
I think I am unable to fully understand your use-case.
Suppose the folder structure is as follows -
Code: Select all

Is it that the homepage shows only grandparent-1, grandparent-2 where clicking grandparent-2 shows only parent-3, parent-4 and clicking parent-3 finally lists the two pages child-page-5, child-page-6 ?

If not, please use the tree structure above to show exactly what you wish.
Post some mockups if possible.

What you described up here is exactly what want to achieve.
To be more elaborate

Grand parents are listed on homepage thus:

Homepage (say if k_is_home)
GR1(Folder) - links to parent1 and 2 on say product.php template.
GR2(Folder) - links to 3 and 4

Product Template (say if k_is_list)
Parent1(folder) - links to child1(page) and child2(page)
Parent2 - links to child 3 and 4.

This sort of hierarchy is what is desired.

Thank you.
I'll give you some sample code that you should be able to tweak to suit your use-case.
Code: Select all
<cms:if k_is_home || k_is_folder> 
    <cms:folders masterpage='products.php' hierarchical='1' depth='1' childof=k_folder_name>
        <a href="<cms:show k_folder_link />"><cms:show k_folder_name /></a><br>
        <!-- if folder has pages and has no sub-folders -->
        <cms:if k_folder_pagecount && k_folder_immediate_children='0'>
            <cms:pages masterpage='products.php' folder=k_folder_name >
                <a href="<cms:show k_page_link />"><cms:show k_page_name /></a><br>

The key above is the use of hierarchical='1' depth='1' childof=k_folder_name with cms:folders.
A depth of 1 will only fetch the immediate child folders of the folder used with the 'childof' parameter.

Hope it helps.
Thanks KK, I'll try as soon as I get on my PC.

I appreciate.
Thank you KK,

The first level transition from folders to child folders worked. However, the instruction code to enumerate folders when there are no child folders did not work.

Also for the child folders enumerated, child pages it contained were also not listed. I tried a number of tweaks to see I can get lucky, but I wasn't successful.

I'll attempt to put the code here shortly.

Thank you.
12 posts Page 1 of 2

Who is online

In total there are 3 users online :: 0 registered, 0 hidden and 3 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 3 guests