Jump to content

how to determine a child page is an ordinary page or pages of PageTable field type within a template ?


Recommended Posts

Posted

When looping the page tree to build a navigation menu,  to determine whether a page has child page

I always use $page->hasChildren to check for child pages. However this checking  is TRUE if for pages created by PageTable field of a template.

 

 

Posted

Hello @adrianmak,

you could give $page->hasChildren() an selector, for example:

$page->hasChildren("template=home|basic-page");

Otherwise I don't know, if it is possible to tell, if a page was created using PageTable, because it is an regular page after all, as far as I know.

Regards, Andreas

 

Posted

You shouldn't get yourself in a situation where you have some children that are part of a menu and some that are part of a PageTable field - it will be a terrible mess. Avoid this by designating an alternate location for storing the pages for the PageTable field - somewhere under a hidden parent, or even under a dedicated parent under Admin.

  • Like 4
Posted
1 hour ago, adrian said:

You shouldn't get yourself in a situation where you have some children that are part of a menu and some that are part of a PageTable field - it will be a terrible mess. Avoid this by designating an alternate location for storing the pages for the PageTable field - somewhere under a hidden parent, or even under a dedicated parent under Admin.

If as you said, put them under the Admin parent, ordinary editor (without superuser role), he cannot add new pages of PageTable .

is it possible to put them under the Admin page and ordinary editor is still able to add new pages.

BaiduShurufa_2016-11-18_7-41-47.png

Posted

Yeah, that is what I have done in the past - no problem with editor role users making new pages - just need to set the template permissions correctly.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...