Problems, need help? Have a tip or advice? Post it here.
5 posts Page 1 of 1
@All Couchies,

I am having a template with Dynamic Folders.
I have created 175 folders in it.
Now I want to display the total count of the folders. To do that I am using the following code:
Code: Select all
<cms:folders masterpage='business-listing.php' depth='1'>
    <cms:show k_total_folders />
</cms:folders>


The issue is that since there are total 175 folders, the number "175" is displayed 175 times. While I want to display it only once.
What changes should I make in the code?

Regards,
GenXCoders
Image
where innovation meets technology
One way could be this -
Code: Select all
<cms:folders masterpage='business-listing.php' depth='1'>
    <cms:if k_first_child >
        <cms:show k_total_folders />
    </cms:if>
</cms:folders>

Hope it helps.
@KK Sir,

there are 45 parent folders and total of 175 folders. the code you suggested, i.e.:
Code: Select all
<cms:folders masterpage='business-listing.php' depth='1'>
    <cms:if k_first_child >
        <cms:show k_total_folders />
    </cms:if>
</cms:folders>


outputs "45" once.

But if I do the following:
Code: Select all
<cms:folders masterpage='business-listing.php' depth='0'>
        <cms:if k_first_child >
            <cms:show k_total_folders />
        </cms:if>
    </cms:folders>

O/P: 175 (repeated 27 times)


or

Code: Select all
<cms:folders masterpage='business-listing.php' depth='0'>
        <cms:if k_first_child >
            <cms:show k_total_folders />
        </cms:if>
    </cms:folders>

O/P: 175 (repeated 25 times)


or

Code: Select all
<cms:folders masterpage='business-listing.php' depth='0'>
        <cms:if k_last_child >
            <cms:show k_total_folders />
        </cms:if>
    </cms:folders>

O/P: 175 (repeated 25 times)


While i am looking at something to show all folders count (in my case 175) only once.

Please suggest.

Regards,
GenXCoders
Image
where innovation meets technology
This will work:
Code: Select all
<cms:folders paginate='1' hierarchical='1' limit='1' >
    <cms:show k_total_folders />
</cms:folders>
@trendoman

Yes it worked.
Thanks a lot!

Regards,
GenXCoders
Image
where innovation meets technology
5 posts Page 1 of 1