Problems, need help? Have a tip or advice? Post it here.
10 posts Page 1 of 1
Current Standing:
1. I have a clonable template with dynamic folders
2. Almost each folder has more than 5 sub folders

What is required?
1. When the page loads in front end, all top level folders needs to be displayed (Grid type design).
2. When a folder is clicked, the sub folders (with same design as above) needs to be displayed
3. When a Sub folder is clicked, the page list needs to be displayed.
4. When list is clicked, details page needs to be displayed.

Totally confused. Please help!
Image
where innovation meets technology
When you have HTML ready, post it here and I'll help with CMS part. Anyway there is nothing that hasn't been explained in docs http://couchdocs/concepts/using-folders.html
@trendoman

What is confusing me is the fact that i am unable to understand how to use the same template to display
1st Parent (top level) folders which when clicked would lead to
2nd child folders of the parent and so on
3rd will display a list of pages (list view)
4th will display page view of the post

this is the code i have now:
Code: Select all
<cms:if k_is_home >
                    <cms:folders masterpage='listing-detail.php' order='asc' depth='1' paginate='1' limit='12'>
                    <div class="col-md-3 col-sm-6 col-xs-12" style="height: 280px;">
                        <a href="<cms:show k_folder_link />">
                            <div class="categorie_item" style="height: 250px;">
                                <div class="cate_item_block hi-icon-effect-8" style="height: 210px;">
                                    <div class="cate_item_social hi-icon">
                                        <img src="<cms:show k_folder_image />" />
                                    </div>
                                    <h1><cms:show k_folder_title /></h1>
                                </div>
                            </div>
                        </a>
                    </div>
                    </cms:folders>
                    </cms:if>

                    <cms:if k_is_folder>
                    <cms:folders masterpage='listing-detail.php' child_of=k_folder_name depth='1' hierarchial='1' >
                    <div class="col-md-3 col-sm-6 col-xs-12" style="height: 280px;">
                        <a href="<cms:show k_folder_link />">
                            <div class="categorie_item" style="height: 250px;">
                                <div class="cate_item_block hi-icon-effect-8" style="height: 210px;">
                                    <div class="cate_item_social hi-icon">
                                        <img src="<cms:show k_folder_image />" />
                                    </div>
                                    <h1><cms:show k_folder_title /></h1>
                                </div>
                            </div>
                        </a>
                    </div>
                    </cms:folders>
                    </cms:if>
Image
where innovation meets technology
Please use this code to navigate around your folders and get a grasp of what is going on.
A very important part is to always use correct parameters - I have found 2 spelling errors in your sample: childof and hierarchical. Maybe this was the reason things didn't work out right away?

Code: Select all
<cms:if k_is_home >
   
    <h2>Home-view</h2>
   
   
    <cms:folders masterpage='listing-detail.php' order='asc' depth='1' paginate='1' limit='12' >
        <cms:show k_folder_title />: <a href="<cms:show k_folder_link />"><cms:show k_folder_link /></a><br/>
    </cms:folders>
   
<cms:else_if k_is_folder />
   
    <h2>Folder-view<cms:if k_folder_parentid = '-1' > (top-level)</cms:if></h2>
   
   
    <h3>Current folder is: <a href="<cms:show k_folder_link />"><cms:show k_folder_title /></a></h3>
   
   
    <cms:if k_folder_immediate_children >
       
        <h3>subfolders:</h3>
       
       
        <cms:folders masterpage='listing-detail.php' childof=k_folder_name depth='1' >
            <cms:show k_folder_title />: <a href="<cms:show k_folder_link />"><cms:show k_folder_link /></a><br/>
        </cms:folders>
       
    <cms:else />
        <h3>no subfolders.</h3>
    </cms:if>
   
<cms:else_if k_is_page />
    <h2>Page-view</h2>
</cms:if>
@trendoman
I tried your code and this is what i have now:
Code: Select all
<cms:if k_is_home >
                        <cms:folders masterpage='listing-detail.php' order='asc' depth='1' paginate='1' limit='12'>
                            <div class="col-md-3 col-sm-6 col-xs-12" style="height: 280px;">
                                <a href="<cms:show k_folder_link />">
                                    <div class="categorie_item" style="height: 250px;">
                                        <div class="cate_item_block hi-icon-effect-8" style="height: 210px;">
                                            <div class="cate_item_social hi-icon">
                                                <img src="<cms:show k_folder_image />" />
                                            </div>
                                            <h1><cms:show k_folder_title /></h1>
                                        </div>
                                    </div>
                                </a>
                            </div>
                        </cms:folders>
                    <!-- Folder View -->
                    <cms:else_if k_is_folder />
                        <cms:if k_folder_immediate_children >
                            <cms:folders masterpage='listing-detail.php' childof=k_folder_name depth='1' hierarchical='1' >
                                <div class="col-md-3 col-sm-6 col-xs-12" style="height: 280px;">
                                    <a href="<cms:show k_page_folderlink />">
                                        <div class="categorie_item" style="height: 250px;">
                                            <div class="cate_item_block hi-icon-effect-8" style="height: 210px;">
                                                <div class="cate_item_social hi-icon">
                                                    <img src="<cms:show k_folder_image />" />
                                                </div>
                                                <h1><cms:show k_folder_title /></h1>
                                            </div>
                                        </div>
                                    </a>
                                </div>
                            </cms:folders>
                        </cms:if>
                    <!-- Page View -->
                    <cms:else_if k_is_page />
                        <cms:folders masterpage='listing-detail.php' childof=k_folder_name depth='1' hierarchical='1' >
                            <cms:pages masterpage='listing-detail.php' folder=k_folder_name order='asc'>
                                <div class="recent-listing-box-container-item list-view-item">
                                    <div class="col-md-4 col-sm-12 nopadding feature-item-listing-item listing-item">
                                        <div class="recent-listing-box-image">
                                            <h1><cms:show k_page_title /></h1>
                                            <img src="http://via.placeholder.com/350x150" alt="img1">
                                        </div>
                                        <div class="hover-overlay">
                                            <div class="hover-overlay-inner">
                                                <ul class="listing-links">
                                                    <li>
                                                        <a href="<cms:show k_page_link />">
                                                            <i class="fa fa-eye blue-1"></i>
                                                        </a>
                                                    </li>
                                                </ul>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-8 col-sm-12 nopadding">
                                        <div class="recent-listing-box-item">
                                            <div class="listing-boxes-text">
                                                <!-- Title -->
                                                <a href="listing_detail.html">
                                                    <h3>Title 2</h3>
                                                </a>
                                                <!-- Title -->
                                                <!-- Phone -->
                                                <a href="tel:+918983044369">
                                                    <i class="fa fa-phone"></i> +91 8983044369
                                                </a>
                                                <!-- Phone -->
                                                <!-- Description -->
                                                <p>Some description goes in here.</p>
                                                <!-- Description -->
                                            </div>
                                            <div class="recent-feature-item-rating">
                                                <!-- Address -->
                                                <h2>
                                                    <i class="fa fa-map-marker"></i>Address, Pincode
                                                </h2>
                                                <!-- Address -->
                                                <!-- Rating -->
                                                <span>
                                                    <i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star-o"></i>
                                                </span>
                                                <!-- Rating -->
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </cms:pages>
                        </cms:folders>
                    </cms:if>


Now this is what happens:
1. I get the Top level or parent folders
When clicked on
2. i get the child folder
when clicked
i should get the list view (page list) but i am not.

I didnot notice the spelling mistakes. Thanks for pointing out.
Image
where innovation meets technology
The fact is that all folder-handling is done within k_is_folder (folder-view). The same folder-view is responsible for listing cloned pages that belong to this folder. Of course, it is done the way you did - with cms:pages. However, your mistake is in placing "cms:pages" in k_is_page (page-view) section.

So, when you click on the last child folder, browser redirects you to its folder-view, where you are supposed to list pages.

The block that I had in my sample had else statement, which helps to have some code in case we are viewing the deepest subfolder, which doesn't have any other subfolders and only can contain cloned pages. I think if you place your "cms:pages" block into that alternative, you'll see the desired list right away.
Code: Select all
<cms:if k_folder_immediate_children >
<!-- show subfolders -->
<cms:else />
<!-- no more subfolders (deepest level) -->
</cms:>
@trendoman

I could still not get it to work. This is the changes code as per your suggestion:

Code: Select all
<!-- Home View -->
                    <cms:if k_is_home >
                        <cms:folders masterpage='listing-detail.php' order='asc' depth='1' paginate='1' limit='12'>
                            <div class="col-md-3 col-sm-6 col-xs-12" style="height: 280px;">
                                <a href="<cms:show k_folder_link />">
                                    <div class="categorie_item" style="height: 250px;">
                                        <div class="cate_item_block hi-icon-effect-8" style="height: 210px;">
                                            <div class="cate_item_social hi-icon">
                                                <img src="<cms:show k_folder_image />" />
                                            </div>
                                            <h1><cms:show k_folder_title /></h1>
                                        </div>
                                    </div>
                                </a>
                            </div>
                        </cms:folders>
                    <!-- Folder View -->
                    <cms:else_if k_is_folder />
                        <cms:if k_folder_immediate_children >
                            <cms:folders masterpage='listing-detail.php' childof=k_folder_name depth='1' hierarchical='1' >
                                <div class="col-md-3 col-sm-6 col-xs-12" style="height: 280px;">
                                    <a href="<cms:show k_page_folderlink />">
                                        <div class="categorie_item" style="height: 250px;">
                                            <div class="cate_item_block hi-icon-effect-8" style="height: 210px;">
                                                <div class="cate_item_social hi-icon">
                                                    <img src="<cms:show k_folder_image />" />
                                                </div>
                                                <h1><cms:show k_folder_title /></h1>
                                            </div>
                                        </div>
                                    </a>
                                </div>
                            </cms:folders>
                        <cms:else />
                            <cms:folders masterpage='listing-detail.php' childof=k_folder_name depth='1' hierarchical='1' >
                            <cms:pages masterpage='listing-detail.php' folder=k_folder_name order='asc'>
                                <div class="recent-listing-box-container-item list-view-item">
                                    <div class="col-md-4 col-sm-12 nopadding feature-item-listing-item listing-item">
                                        <div class="recent-listing-box-image">
                                            <h1><cms:show k_page_title /></h1>
                                            <img src="http://via.placeholder.com/350x150" alt="img1">
                                        </div>
                                        <div class="hover-overlay">
                                            <div class="hover-overlay-inner">
                                                <ul class="listing-links">
                                                    <li>
                                                        <a href="<cms:show k_page_link />">
                                                            <i class="fa fa-eye blue-1"></i>
                                                        </a>
                                                    </li>
                                                </ul>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-8 col-sm-12 nopadding">
                                        <div class="recent-listing-box-item">
                                            <div class="listing-boxes-text">
                                                <!-- Title -->
                                                <a href="listing_detail.html">
                                                    <h3>Title 2</h3>
                                                </a>
                                                <!-- Title -->
                                                <!-- Phone -->
                                                <a href="tel:+918983044369">
                                                    <i class="fa fa-phone"></i> +91 8983044369
                                                </a>
                                                <!-- Phone -->
                                                <!-- Description -->
                                                <p>Some description goes in here.</p>
                                                <!-- Description -->
                                            </div>
                                            <div class="recent-feature-item-rating">
                                                <!-- Address -->
                                                <h2>
                                                    <i class="fa fa-map-marker"></i>Address, Pincode
                                                </h2>
                                                <!-- Address -->
                                                <!-- Rating -->
                                                <span>
                                                    <i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star-o"></i>
                                                </span>
                                                <!-- Rating -->
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </cms:pages>
                        </cms:folders>
                        </cms:if>
                    <!-- Page View -->
                    <cms:else_if k_is_page />
                        Page View
                    </cms:if>
Image
where innovation meets technology
At this moment you almost got it right. Another mistake is to use "cms:folders" loop to enumerate non-existent subfolders of the very last subfolder. In other words, once last subfolder clicked, else block of "<cms:if k_folder_immediate_children >" is triggered, because there are no more subfolders. Therefore, your code should respect that and already start listing pages there.
@trendoman

This is the current code, as you suggested the changes:

Code: Select all
<!-- Home View -->
                    <cms:if k_is_home >
                        <cms:folders masterpage='listing-detail.php' order='asc' depth='1' paginate='1' limit='12'>
                            <div class="col-md-3 col-sm-6 col-xs-12" style="height: 280px;">
                                <a href="<cms:show k_folder_link />">
                                    <div class="categorie_item" style="height: 250px;">
                                        <div class="cate_item_block hi-icon-effect-8" style="height: 210px;">
                                            <div class="cate_item_social hi-icon">
                                                <img src="<cms:show k_folder_image />" />
                                            </div>
                                            <h1><cms:show k_folder_title /></h1>
                                        </div>
                                    </div>
                                </a>
                            </div>
                        </cms:folders>
                    <!-- Folder View -->
                    <cms:else_if k_is_folder />
                        <cms:if k_folder_immediate_children >
                            <cms:folders masterpage='listing-detail.php' childof=k_folder_name depth='1' hierarchical='1' >
                                <div class="col-md-3 col-sm-6 col-xs-12" style="height: 280px;">
                                    <a href="<cms:show k_page_folderlink />">
                                        <div class="categorie_item" style="height: 250px;">
                                            <div class="cate_item_block hi-icon-effect-8" style="height: 210px;">
                                                <div class="cate_item_social hi-icon">
                                                    <img src="<cms:show k_folder_image />" />
                                                </div>
                                                <h1><cms:show k_folder_title /></h1>
                                            </div>
                                        </div>
                                    </a>
                                </div>
                            </cms:folders>
                        <cms:else />
                            <cms:if k_is_page >
                                <cms:folders masterpage='listing-detail.php' childof=k_folder_name depth='1' hierarchical='1' >
                                <cms:pages masterpage='listing-detail.php' folder=k_folder_name order='asc'>
                                    <div class="recent-listing-box-container-item list-view-item">
                                        <div class="col-md-4 col-sm-12 nopadding feature-item-listing-item listing-item">
                                            <div class="recent-listing-box-image">
                                                <h1><cms:show k_page_title /></h1>
                                                <img src="http://via.placeholder.com/350x150" alt="img1">
                                            </div>
                                            <div class="hover-overlay">
                                                <div class="hover-overlay-inner">
                                                    <ul class="listing-links">
                                                        <li>
                                                            <a href="<cms:show k_page_link />">
                                                                <i class="fa fa-eye blue-1"></i>
                                                            </a>
                                                        </li>
                                                    </ul>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-8 col-sm-12 nopadding">
                                            <div class="recent-listing-box-item">
                                                <div class="listing-boxes-text">
                                                    <!-- Title -->
                                                    <a href="listing_detail.html">
                                                        <h3>Title 2</h3>
                                                    </a>
                                                    <!-- Title -->
                                                    <!-- Phone -->
                                                    <a href="tel:+918983044369">
                                                        <i class="fa fa-phone"></i> +91 8983044369
                                                    </a>
                                                    <!-- Phone -->
                                                    <!-- Description -->
                                                    <p>Some description goes in here.</p>
                                                    <!-- Description -->
                                                </div>
                                                <div class="recent-feature-item-rating">
                                                    <!-- Address -->
                                                    <h2>
                                                        <i class="fa fa-map-marker"></i>Address, Pincode
                                                    </h2>
                                                    <!-- Address -->
                                                    <!-- Rating -->
                                                    <span>
                                                        <i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star-o"></i>
                                                    </span>
                                                    <!-- Rating -->
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </cms:pages>
                                </cms:folders>
                            </cms:if>
                        </cms:if>


No luck yet. Not Going to list view of pages (posts)
Keeps on showing the folders.

I added a 2nd sub folder, does not even go there. What can be wrong?
Image
where innovation meets technology
genxcoders wrote: This is the current code, as you suggested the changes:


With all chances, I did not suggest the changes you introduced in previous post.
Let me give you a suggested code frame from my previous post.
Code: Select all
...
<cms:else_if k_is_folder />
    <cms:if k_folder_immediate_children >
        <cms:folders masterpage='listing-detail.php' childof=k_folder_name depth='1' hierarchical='1' >
            <h3><cms:show k_folder_title /></h3>
        </cms:folders>
    <cms:else />
        <cms:pages masterpage='listing-detail.php' folder=k_folder_name order='asc'>
            <h3><cms:show k_page_title /></h3>
        </cms:pages>
    </cms:if>
</cms:if>

Hope it finally busts the hump.
10 posts Page 1 of 1