Problems, need help? Have a tip or advice? Post it here.
6 posts Page 1 of 1
This is my code:

Code: Select all
<cms:folders masterpage='en/web-graphics.php'>
<li class="mr-sm" <cms:if k_template_name=='<cms:show k_folder_title />'>class="active"</cms:if>><a class="btn portfolio-tabs-button" href="<cms:show k_folder_link />"><cms:show k_folder_title /></a></li>
</cms:folders>


What I would like to do is to add an image (or icon) for every folder and show that image together with the folder name.

Is that possible with Couch?
In the admin-panel, when you edit a folder, you can attach an image with that folder (there is a field for this purpose).
On the front-end, the <cms:folders> tag will make available that image through a variable named 'k_folder_image'.

Hope this helps.

P.S. As an aside, the code you pasted has a little bug in it in the following statement -
Code: Select all
 <cms:if k_template_name=='<cms:show k_folder_title />'

It either needs to use "double-quotes" -
Code: Select all
 <cms:if k_template_name=="<cms:show k_folder_title />"

or just the variable name -
Code: Select all
 <cms:if k_template_name==k_folder_title

Please see https://docs.couchcms.com/concepts/sett ... eters.html if you need help on why the change is needed.
Thanks for the reply!

How can I edit folders and add images to it? I don't see that option anywhere in the admin.

I've created virtual folders like this:

Code: Select all
<cms:folder name="folderone" title="Folder one" />
<cms:folder name="foldertwo" title="Folder two" />
<cms:folder name="folderthree" title="Folder three" />



EDIT: I see now in the documentation that there are Dynamic Folders so I assume this is the proper way to do it. If that's true, how can I replace Virtual Folders with Dynamic Folders?
how can I replace Virtual Folders with Dynamic Folders?

Please see https://docs.couchcms.com/miscellaneous ... lders.html

Hope this helps.
Awesome, it's working, thanks :)

I have few folders and some entries in it. When I click on one folder name, the URL gets that name in it. How can I set that when one folder is active, I have "active" (or whatever) class on it?

On the screenshot, the "Dizajn aplikacija" is active and the URL is /appdizajn.

Attachments

Please see the following post -
viewtopic.php?f=2&t=7389#p10667

Hope it helps.
6 posts Page 1 of 1