Translations of this page?:
General
Getting Support
Administration
Design
Wolf Reference
Plugin Development
Core Development
- Design documents
- Working guidelines
- References
Press, Graphics and Translations
Wolf CMS books section
childrenCount()
The childrenCount() function returns a count of how many child pages belong to the current page. A simple echo $this->childrenCount(); will return the number of “published” pages to the current page.1)
childrenCount() can be useful, then, for determining when to include navigation, for example:
<?php if ($this->childrenCount() > 0) { // if count is > 0, there are child pages, so do stuff } else { // no child pages, so do something else } ?>
It takes the same parameters as the children() function; see the documentation there for details.
1)
See the children() function documentation for how to include “hidden” pages.
Except where otherwise noted, content on this wiki is licensed under the following license:GNU Free Documentation License 1.2
