Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Hi,
I want to achieve this:
Using the same listing page I want to do the following:
Scenario 1
Scenario 1.jpg
Scenario 1.jpg (473.49 KiB) Viewed 813 times


Scenario 2
Scenario 2.jpg
Scenario 2
Scenario 2.jpg (280.08 KiB) Viewed 813 times


Scenario 3
Scenario 3.jpg
Scenario 3
Scenario 3.jpg (481.17 KiB) Viewed 813 times


How do I achieve this using a single listing page and the pages listing tag:
Code: Select all
<cms:pages masterpage="blog-post.php" paginate='1' limit='8' folder=k_folder_name start_on=k_archive_date stop_before=k_next_archive_date>
......
</cms:pages>


Thank you
Hi,

The usual method of first checking for which view we are in (https://docs.couchcms.com/concepts/views.html) and then accordingly displaying the pages (https://docs.couchcms.com/concepts/listing-pages.html) should suffice.

You may also find using the 'smart_embed' method useful - https://docs.couchcms.com/miscellaneous ... embed.html
Thanks KK,
I did this for the first scenario:
Code: Select all
<cms:if k_is_list>
<cms:pages masterpage="news.php" paginate='1' limit='6' folder='NOT in-the-media' start_on=k_archive_date stop_before=k_next_archive_date>
       <cms:if k_page_foldertitle>
        <cms:set my_category=k_page_foldertitle/>
       <cms:else />
       <cms:set my_category='Uncategorized'/>
       </cms:if>
       <span class="post-cat"><a href="<cms:show k_page_folderlink />"><i class="icon icon-folders"></i> <cms:show my_category /></a></span>
</cms:pages>
</cms:if k_is_list>


It works fine by excluding the pages from "In the media", however when I click on any of the folders (Latest news or Events) to filter out pages of each respective folder, it still shows all the pages and I can't seem to find my head around it
3 posts Page 1 of 1