Home » Documentation » $Content->children()


Returns a stack of content objects that have been added as children to $Content.

To list the children of a piece of content:

// list them all at once

// list one at a time
while ($child = $content->children()->getNext()) { 

By default, children includes the 20 most recently added children objects. You can change this by passing in a count to the first call to this function.

// lets get 500 children!

To add a piece of content as a child to another document, set it's parentId field.

// create a new piece of content
$new_content = $POD->getContent();
$new_content->set('headline','new child document');

// set its parentId and save it

// now we can use the parent and children functions



Of note: The children stack does not automatically reload when you add a new child. If you have already loaded it once, you will have to force a reload by using the $Stack->fill() function:

// load and display all the children

// now create a new child

// now we need to reload children
  • Discuss This Document

No comments have been posted yet.

Download Download the latest version of PeoplePods!

0.7 Latest Version:
Release Notes

A free membership is required to download PeoplePods.

  Already Registered? Login

Recent Posts from Our Blog

Developer Preview Launch!

I am very excited to announce the launch of PeoplePods version 0.666, THE DEVELOPER PREVIEW! After tons of hacking, I have tweaked the last line of code, and I am finally ready for a wider audience...