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.

Data Model Questions

Search and Sort: How to?


Reply

2 Posts   245 Views

Avatar
pinkp

25 April 2013 at 12:15am Community Member, 168 Posts

I just need a little guidance as to the correct way to achieve the following.
I am creating a "Members Directory" (not members who have log in etc just a separate membership list).

Basically in the CMS you will add a "Member" they will have name, website, discipline, about paragraph, image.

1> Then what I need to know is how in the front end these can be sorted Alphabetically, and also the option to sort by Discipline.
2> How can i create a search just for these members, i.e. I search for "john smith poet" and this will filter the results.

Currently looking at:
http://api.silverstripe.org/3.0/class-SearchContext.html
http://doc.silverstripe.org/framework/en/reference/modeladmin
http://blog.fraser-hart.co.uk/silverstripe-3-gridfield-with-many_many-relationship/#comment-1182
http://www.ssbits.com/tutorials/2011/sorting-on-a-related-dataobject-in-modeladmin/
http://doc.silverstripe.org/framework/en/topics/datamodel
http://doc.silverstripe.org/framework/en/tutorials/5-dataobject-relationship-management
http://doc.silverstripe.org/framework/en/tutorials/4-site-search

Avatar
swaiba

25 April 2013 at 12:50am Forum Moderator, 1796 Posts

DataObject::get allows specify a sort...

http://api.silverstripe.org/3.0/source-class-DataObject.html#2692-2746