adimpressions wrote: but it kept sending me to the same single folder page I am on.
It happens because of 2 things: (1) 'list-view-page.php' is a template with dynamic folders and (2) "f" is couch-reserved parameter which tells the cms to go to folder-view. I think if you change that parameter to something else (not "p, f, d"), things should work fine.
Your template's structure might then look like this:
- Code: Select all
<!-- Check if list of pages requested -->
<cms:set my_folder = "<cms:gpc 'pagesof' method='get' />" />
<cms:if my_folder >
<!-- Showing list of pages of some folder -->
<cms:pages folder=my_folder >
<!-- html -->
</cms:pages>
<cms:else_if k_is_home />
<!-- Show list of folders -->
<cms:else_if k_is_folder />
<!-- Show folder description -->
<cms:else_if k_is_page />
<!-- Show one page -->
</cms:if>
In the sample above, I used some arbitrary querystring parameter
pagesof, which has no conflicts with CMS.
At first, code checks for presense of this parameter in URL, then allows all regular views to work, if parameter not present.
So, your links then look like this.
- Code: Select all
<a href=‘<cms:add_querystring “<cms:link ‘list-view-page.php’ />” “pagesof=<cms:show k_folder_name />” />’ >link to sorted pages list view</a>
-----
Alternatively, you may have another URL. For example, have the usual URL for default folder-view
mysite.com/my-folder/ (showing folder description) and URL for list of pages
mysite.com/my-folder/?show_pages=yes. Then template's structure is changed to this.
- Code: Select all
<cms:if k_is_home />
<!-- Show list of folders -->
<cms:else_if k_is_folder />
<!-- Check if list of pages requested -->
<cms:set show_pages = "<cms:gpc 'show_pages' method='get' />" />
<cms:if show_pages eq 'yes' >
<!-- Showing list of pages of this folder -->
<cms:pages folder=k_folder_name >
<!-- html -->
</cms:pages>
<cms:else />
<!-- Showing folder description -->
</cms:if>
<cms:else_if k_is_page />
<!-- Show one page -->
</cms:if>
I personally prefer this structure, as it deals with folder-view only and doesn't require to pass folder name in parameters.
Therefore a sample link-building code:
- Code: Select all
<h2>Links to each folder</h2>
<cms:folders masterpage='my-template-with-folders.php'>
<a href=‘<cms:link ‘my-template-with-folders.php’ folder=k_folder_name />’ >link to description of folder: <cms:show k_folder_title /></a>
<a href=‘<cms:add_querystring “<cms:link ‘my-template-with-folders.php’ folder=k_folder_name />” “show_pages=yes” />’ >link to sorted pages of folder: <cms:show k_folder_title /></a>
</cms:folders>
Btw, "cms:link" recognizes parameter
folder, which really helps with getting pretty links right away.