Ok, I've been learning Silverstripe and I've gone though the first tutorials. I've been using the book and the forums/documentation etc to learn everything, and so far so good. However I'm having some issues attempting to work with the ModelAdmin class for the first time, and I haven't really done much.
I've created a quotes system that shows a random quote in the side bar on every page. I have a database of quotes and the sidebar module is working correctly. Now I want to make an admin tool to allow admin to manage the quotes, edit and add new ones. I've created an admin area with the following code:
<?php
class QuoteAdmin extends ModelAdmin {
static $managed_models = array(
'Quote'
);
static $searchable_fields = array(
'Individual',
'Occupation',
'Topic',
'Year',
'Quote',
);
static $url_segment = 'quotes';
static $menu_title = 'Quotes';
static $model_importers = array(
'Quote' => 'QuoteCsvBulkLoader',
);
}
?>
I have two issues with this that I cannot seem to resolve.
1: None of the search fields show. At all. Only one field shows called '#ID' (It is a drop down box that contains an entry for every quote in the db.
2: None of the data fields show in the search results. Only #ID for each quote. However clicking the results shows the quotes and allows them to be edited.
What am I missing? I'm assuming the two issues are related but I can't track down the answer. And yes, I know I'm a newb. ;)