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.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

simple dropdown to query data


Go to End


945 Views

Avatar
ZM

Community Member, 4 Posts

1 October 2011 at 1:24am

Edited: 01/10/2011 2:13am

hello,

I created a dataobject like this:

class StaffMember extends DataObject
{
    //db fields
    static $db = array (
        'Name' => 'Varchar(255)',
        'Role' => 'Varchar(100)',
        'Description' => 'Text'
    );

now like create a StaffPage.ss page which can use a dropdown field and filter/query only e.g. Roles like "Manager".
In this dropdown field should all Roles available and only that chosen Members with the Role should be displayed.

I know that is simple but I can't find a solution, so thank you for your help.

bye
Hans