Jump to:

3460 Posts in 1064 Topics by 739 members

Data Model Questions

SilverStripe Forums » Data Model Questions » Sort products

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

Page: 1 2
Go to End
Author Topic: 2230 Views
  • martimiz
    Avatar
    Forum Moderator
    1086 Posts

    Re: Sort products Link to this post

    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 ...

  • liece
    Avatar
    Community Member
    9 Posts

    Re: Sort products Link to this post

    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

    2230 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.