Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
For some reason the code below shows the list of all the folders instead of the specific folder the post belongs to.
Code: Select all
 <cms:pages masterpage='events.php' folder=k_folder_name paginate='1' limit='6'>
    <cms:show k_page_title />
    <cms:folders masterpage='events.php'>
        <a href="<cms:show k_folder_link />">
            <cms:show k_folder_title />
        </a>
    </cms:folders>         
</cms:pages>


Contents of events.php:
Code: Select all
<cms:template title='Events' clonable='1' dynamic_folders='1' order='3'>
   ...
</cms:template>


What might be the reason for such behaviour? And, how to fix it?
The <cms:folders> is supposed to list folders and that is exactly what it is doing.
That said, you don't need to use it in your use-case as <cms:pages> itself provides info about each page's folder.

Please remove the <cms:folders> tag block from your code and place a <cms:dump /> there instead.
You'll get to know which variables are the ones you need to use for the folder info.

Hope this helps.
Using <cms:dump /> helped a lot! I got it to work like so:
Code: Select all
 
<cms:pages masterpage='events.php' folder=k_folder_name paginate='1' limit='6'>
    <cms:show k_page_title />
   <a href="<cms:show k_folder_link />">
      <cms:show k_page_foldername />
   </a>
</cms:pages>
3 posts Page 1 of 1

Who is online

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

Users browsing this forum: No registered users and 9 guests