Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Accessing an individual children?


Go to End


4 Posts   1251 Views

Avatar
tomklang

Community Member, 6 Posts

2 February 2010 at 12:43am

Hi!

Can somebody explain a simple way how to access an individual children (Article Title/Body) without using
the control childrenOf command?

The disadvantage here is that you have to define an additional layer within the site structure...

Thanks for your help

Avatar
Willr

Forum Moderator, 5523 Posts

2 February 2010 at 11:49am

Sorry perhaps not really understanding the question. If you want a specific page on the site you can use <% control Page(page-url) %> to get a single page regardless of what the site structure is.

Avatar
tomklang

Community Member, 6 Posts

3 February 2010 at 12:27am

Thanks,

is it also possible to access the children by a parameter "order",
meaning the first, second, third etc.... in order of appearance within the cms interface?

best,
tom

Avatar
carlos

Community Member, 42 Posts

9 February 2010 at 6:08pm

Hi,

you can create a function to do that.

$children = DataObject::get("SiteTree","ParentID = '$this->ID'","Date DESC");
if($children) return $children;
return null;