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.

Data Model Questions /

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

Sort products


Go to End


10 Posts   4377 Views

Avatar
martimiz

Forum Moderator, 1391 Posts

6 May 2011 at 7:12am

that's probably because <% control Children %> returns a couple of Page class DataObjects, not Page_Controllers, meaning you have no access to methods in the children's controller. You could overcome this by creating a similar kind of method in the Page class itself. Feels a bit funny maybe, but ...

Avatar
liece

Community Member, 9 Posts

6 May 2011 at 10:15am

Thanks a lot, that helped.
I moved the function

public function getProductsList($num) 
   { 
      return $this->Products(Null, "Price,Title", Null, $num);

   }

to the CategoryPage Class, so now it can be accessed from the ProjectsHolder template.

It works and I guess i shouldn't have problems with it set up like that...

Thanks man

Go to Top