Forum for discussing general topics related to Couch.
4 posts Page 1 of 1
Hi All, Hope you are having a great day? Please I am in a fix and I need your help to fix it (pun intended).
Okay, I am creating a sort of help page using cloned pages and I used folders to group the help topics into separate 'categories', if you will. Now, I want to display all these folders along with three contents from each folder on the same Home View.

Sort of like this

Folder A
- Content 1
- Content 2
- Content 3

Folder B
- Content 1
- Content 2
- Content 3

Please. how can I go about this?
The Only Nigerian Good Son!
Hi,

There are several threads discussing the same problem.
Essentially the solution consists of nesting cms:pages within cms:folders e.g. as follows -
Code: Select all
<cms:folders>
    <h2><cms:show k_folder_title /></h2>
   
    <cms:pages folder=k_folder_name>
        <h3><cms:show k_page_title /></h2>
    </cms:pages>
</cms:folders>

The key above is the use of folder=k_folder_name with cms:pages which then lists pages belonging to only the folder being iterated.

Both cms:folders and cms:pages tags have other parameters of their own so you can tweak the code above to suit your use-case.

Hope it helps.
Hi Kk, I finally got this working. This is what finally worked for me. I'm now using this in two different ways.
1. To display List of countries and their respective cities
2. To populate the drop-down fields of a form in another page

Thanks for the heads up

Code: Select all
<cms:folders masterpage='cities_list.php'>
   <h2><cms:show k_folder_title /> </h2>
       <cms:pages masterpage='cities_list.php' folder=k_folder_name>
       <li><a href="<cms:show k_page_link />"><cms:show k_page_title /></a></li>
        </cms:pages>
</cms:folders>
The Only Nigerian Good Son!
I'm glad it helped :)
4 posts Page 1 of 1