Forum for discussing general topics related to Couch.
6 posts Page 1 of 1
Hi,

I would like to exclude nested pages when displaying content in home-view: here is my code.

Code: Select all
<cms:pages masterpage='initiative.php' page_name='NOT my-initiative' page='NOT nested_pages' order='ASC' >
            <div class="box col5 <cms:show list_filter />">
              <a href="<cms:show k_page_link />">
                <span class="overlay details"></span>
                <img src="<cms:show t_post_image_thumb/>" alt="<cms:show image_descr />" />
              </a>         
            </div>
          </cms:pages >     



This is not working and still displays nested pages (i don't want them to show)... along with the pages i want displayed.
Hi,

I am a little confused by your use of the term 'nested pages'.
I presume it is what is described at http://www.couchcms.com/docs/concepts/n ... maker.html
Right?

If so, then you should use cms:nested_pages tag (instead of the cms:pages) to list the pages.
Again I presume from your question that by 'exclude nested pages' you meant showing only top level pages and excluding those lower in hierarchy. If so, you can use the 'depth' parameter (as shown below).

Here is how your code would look like when ported to use cms:nested_pages
Code: Select all
<cms:nested_pages masterpage='initiative.php' include_custom_fields='1' exclude='my-initiative' depth='1' order='asc' >
    <div class="box col5 <cms:show list_filter />">
      <a href="<cms:show k_nestedpage_link />">
        <span class="overlay details"></span>
        <img src="<cms:show t_post_image_thumb/>" alt="<cms:show image_descr />" />
      </a>         
    </div>
</cms:nested_pages>

I have made a lot of assumptions about your intended question in my response.
Do let me know if I am wrong and please explain in detail what you meant exactly by 'exclude nested pages'.

Thanks.
Thank you so much for our reply:

I am trying to create menu lists from nested pages, the hierarchy is as follows:
> Parent Page 1
>> Child of Parent Page 1
>>> Child of Child of Parent 1

> Parent Page 2
>> Child of Parent Page 2
>>> Child of Child of Parent 2

I would like to show:
> a menu (list) of parent pages when someone is viewing the parent page,
> a menu (list) of child of parent page when someone clicks on child of parent page,
> a menu (list) of child of child of parent page when someone clicks on child of parent page,

I know how to implement the 2 views: the (home) list view and the page view.

I would like to also use the page view as a list view for child pages for example:
* when on (home) list view:
----- Show a list of parent pages docked on this template
(this works perfectly at the moment.)
* when on page view:
----- Show a menu of lists of child pages nested under the current (active) parent page
* when on a person clicks a link in the menu as above
----- Show a list of child of child pages

I have attached a wireframe aid.

Please help me figure this out as i have tried using if/else statements and all i get is an infinite loop that displays nothing.

Thank you.

wireframe.jpg
wireframe.jpg (28.45 KiB) Viewed 1893 times
wireframe2.jpg
wireframe2.jpg (19.65 KiB) Viewed 1893 times
wireframe3.jpg
wireframe3.jpg (21.82 KiB) Viewed 1893 times
Frustrated me!

Just forget how i have implemented it and advise me on how to implement this:

Cloned page = Name of organization
Nested Page = Organizations' Milestones e.g 2004, 2005, 2006 or Founded, Launch, Awards e,t,c
Nested page of nested page = 2004 > January, February March or Pre-founding activity e.t.c

Menus
If current page is 2004, only show menu with nested pages in 2004
if current page is January, only show menu with nested pages in January

Please Help.. :o
Jephcol,

Please try placing the following in your page-view
Code: Select all
<cms:nested_pages include_custom_fields='1' depth='1' order='asc' childof=k_page_name >
      <a href="<cms:show k_nestedpage_link />">
        <h1><cms:show k_nestedpage_title /></h1>
      </a>         
</cms:nested_pages>

The code above should always list the immediate children of whatever page you are on.
As should be evident, it is the 'childof' parameter that is doing the trick (with depth set to '1' fetching only the immediate children).

One can use the 'root' and 'childof' parameters to create almost all kinds of menu. Please see http://www.couchcms.com/docs/tags-reference/menu.html for a very detailed discussion on the various values these two can take (the doc is about cms:menu tag but everything holds true for cms:nested_pages tag too as cms:menu is just a wrapper around it).

Hope this helps.
:lol: :lol: :lol: :lol: :lol:

Such a simple solution! and to think i lost a few strands trying to get this to work!!?
thank you very much.
6 posts Page 1 of 1
cron