21 February 2009 at 2:47am
I'm trying to create a rather complex news system. My website has a number of sections, some of which have more than one news holders and what I want is for the root of that section to have all of is child news (across all of the holders within that section).
I hope this makes sense.
I have got an overall news, which shows everything and a individual news for that specific holder, but I've got stuck on this bit. If anyone has any clue, I'd greatly appreciate it.
21 February 2009 at 6:06am
OK, I'm getting closer.
using: $Holders = DataObject::get('ArticleHolder'); returns me 3 ArticleHolder's (which is correct across the whole site).
But when I use: $Holders = DataObject::get('ArticleHolder', 'ParentID =' . $this->ID); to get all the holders in the section, it only looks at the direct children.
I need to somehow combine the two.
Thanks for all your help so far.
So on each PageLevel1 I'd like to show the content from the ArticleHolders in lower levels. On PageLevel1-(a) that easy because it's a direct child, but on PageLevel1-(b) I'd like to see the children from both ArticleHolders.
21 February 2009 at 6:37am
Ok, I think your best bet for this would be to have a section tag in the ArticleHolder which you can set, say a the URLSegment of the top level page. That way in you getLatestArticles Function you can do: