Jump to:

23481 Posts in 18951 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Sort back-end (BlogEntry's)

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

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

Page: 1
Go to End
Author Topic: 1156 Views
  • borriej
    Community Member
    267 Posts

    Sort back-end (BlogEntry's) Link to this post

    How can i sort my blogentry's by date?

    Tried things like this, but its not working for me:

    SiteTree::$default_sort = 'IF("SiteTree"."ClassName" = \'BlogEntry\', LOWER("SiteTree"."DESC"), "SiteTree"."Sort")';
    SiteTree::$default_sort = 'IF("SiteTree"."ClassName" = \'BlogEntry\', LOWER("SiteTree"."Created"), "SiteTree"."Sort")';
    SiteTree::$default_sort = 'IF("SiteTree"."ClassName" = \'BlogEntry\', LOWER("SiteTree"."Created"), "SiteTree"."Created")';

    The search form didn't give me much help.

  • adiwidjaja
    Community Member
    14 Posts

    Re: Sort back-end (BlogEntry's) Link to this post

    Late answer, but maybe someone else needs this - I found this solution:

    SiteTree::$default_sort = 'IF("SiteTree"."ClassName" = \'BlogEntry\', NOW() - "SiteTree"."Created", "SiteTree"."Sort")';



Page: 1
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.