billyudi Posted June 26, 2013 Share Posted June 26, 2013 So I'm implementing this... http://wiki.processwire.com/index.php/Bootstrap_Navbar#The_Menu And is works great, however we are about to launch and, well, the content isn't all ready so we have some children pages unpublished. The problem is that even if all the children pages are set to unpublish the parent page still detects there are children and puts in an empty dropdown menu. I'm new to this, so forgive my ignorance. Anyone have any ideas on how to get rid of the dropdown when all children are unpublished? Link to comment Share on other sites More sharing options...
Soma Posted June 26, 2013 Share Posted June 26, 2013 Ah now that's the numChildren problem. In that it isn't published or access aware. Means even if all children are unpublished it will return true. There's now a attribute to make it recognize that Not sure what version it was added exactly but maybe this works for you: change all $child->numChildren to $child->numChildren(true) Or if you use older version you can instead replace it with this: count($child->children) 1 Link to comment Share on other sites More sharing options...
billyudi Posted June 26, 2013 Author Share Posted June 26, 2013 Thanks! That was it I must be on an older version I had to use count($child->children) Link to comment Share on other sites More sharing options...
Soma Posted June 26, 2013 Share Posted June 26, 2013 Ah or with $child->child->id should also work. does it? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now