Problems, need help? Have a tip or advice? Post it here.
9 posts Page 1 of 1
Hey there. I need your help. Is there anyway to show only parent page with cms:pages tag? I know we can do it in nested pages by using depth tag. But If it is possible I need to do it with the pages tag too?
Hi,

Unlike nested-pages, normal cloned pages don't have any hierarchy and hence the concept of child/parents don't apply to them.

Could you please explain the use-case you are working with? Perhaps it requires some other solution.
Hey KK. I created a services page which is using nested_pages. And in homeview I want to show parent and child page together. But child page must show under the parent page. My code is looks like:

Code: Select all
<cms:pages masterpage='services.php' orderby='weight' order='asc''>
            <div class="service-list">
            <div class="column-section clearfix">
                <div class="column one-fourth">
                    <a href=""><i style="padding: 15px; color: #673AB7; border-radius: 25px;" class="ion <cms:show icon /> ion-6x"></i></a>
                </div>
                <div class="column two-fourth">
                    <a href="<cms:show k_page_link />"><h3><cms:show k_page_title /></h3></a>
                    <p><cms:show short_content /></p>
                </div>
                <div class="column one-fourth last-col p10">
                    <p class="mt10 fs15"><strong>Sub Categories</strong></p>
                    <cms:nested_pages masterpage='services.php' childof="<cms:show k_page_name />" depth='1' >
                    <a class="mt5 read-more sr-button-with-arrow" href="<cms:show k_nestedpage_link />"><strong><cms:show k_nestedpage_title /></strong></a><br>
                    </cms:nested_pages>
                </div>
            </div>
            </div>
            </cms:pages>


I want to show child pages only in cms:nested_pages area. But normally cms:pages tag shows the child pages, too. How can I solve this problem?
The cms:nested_pages tag alone should suffice to list the pages.

Could you please post the hierarchy of your nested pages and then let me know clearly exactly how and which of the pages from that hierarchy you wish to show? If necessary, please post some screenshots or mockups. Thanks.
Hey KK I added a screenshot of my services page. It shows what I exactly want to achieve.
Hey KK do you have any solution about this?
Hi,

You did not post the hierarchy of your nested-pages I requested so I'll use a generic example.
Suppose following is how your nested-pages are arranged -
Untitled-1.png
Untitled-1.png (5.86 KiB) Viewed 894 times

Using the following code -
Code: Select all
<cms:nested_pages masterpage='hizmetler.php' include_custom_fields='1' depth='1'>
    <h2><cms:show k_nestedpage_title /></h2>
   
    <cms:nested_pages masterpage='hizmetler.php' include_custom_fields='1' childof=k_nestedpage_name depth='1'>
        <h3> -- <cms:show k_nestedpage_title /></h3>
   
    </cms:nested_pages>
</cms:nested_pages>

- will result in the following output on the front-end
Untitled-2.png
Untitled-2.png (5.27 KiB) Viewed 894 times

As you can see, I used <cms:nested_pages> twice - the outer loop listed only the top level pages while the inner loop then listed pages that were children of the outer loop.

I think you should be able to adapt the code to suit your use-case.
Hope it helps.
Thanks KK It works very well. you are great :))
You are welcome :)
I am glad I could help.
9 posts Page 1 of 1
cron