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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Resolved [ Create page to display additional details field ]

Go to End

3 Posts   846 Views


Community Member, 78 Posts

9 June 2011 at 4:39pm

Edited: 09/06/2011 4:40pm

Hi There,

I am using FileDataObjectManager to create my Resources Page and announcement page.
Is it to possible to create another page to enable visitor to click and see more details for each resource.

On I just display a little information, I want them to click on title and direct to a new page which display only one record with all additional detail information.

Your I really appreciated.



class Resource extends DataObject {

static $db = array(
'Title' => 'Text',
'Description' => 'HTMLText',
'Date' => 'Date'
static $has_one = array(
'ResourcePage' => 'ResourcePage',
'ResourceFile' => 'File'
static $singular_name = "Resource";
static $plural_name = "Resources";

function getCMSFields() {
$fields = new FieldSet(
new TextField('Title', 'Title'),
new SimpleHTMLEditorField('Description', 'Description'),
new FileUploadField('ResourceFile', 'Addional Information'),
new DatePickerField('Date', 'Released Date')
return $fields;

class ResourcePage extends Page {

static $icon = "";
static $db = array();
static $has_one = array();
static $has_many = array(
'Resources' => 'Resource'
static $singular_name = "Resource Page";
static $plural_name = "Resource Pages";
function getCMSFields(){
$myfields = parent::getCMSFields();
$mytable = new FileDataObjectManager(
'Title' => 'Title',
'Description' => 'Description',
'Date' => 'Date'
$myfields->addFieldToTab('Root.Content.Resources', $mytable);
return $myfields;

class ResourcePage_Controller extends Page_Controller{



class ResourcePageHolder extends Page {

static $db = array();
static $allowed_children = array('RsourcePage');
static $singular_name = 'RsourcePage';
class ResourcePageHolder_Controller extends Page_Controller {


<div class="typography">
<% if Resources %>
<% control Resources %>
<div id="announcelist">
<li class="title"><b><a href="$Link">$Title</a></b></li>

<li class="details">
<a href="$ResourceFile.Link"><b>Download Detail</b></a>
<% if Date %>
<span class="listdate"> Expiry Date: $Date.Nice</span>

<% end_if %>

<% end_control %>
<% else %>
<p>There is no record.</p>
<% end_if %>


Forum Moderator, 4102 Posts

10 June 2011 at 4:12am

This has been written up a number of times.. I'd probably start here:

SilverStripe tips, tutorials, screencasts and more:


Community Member, 78 Posts

10 June 2011 at 12:56pm

Good morning,

I have been looking for this kind tutorial
I really appreciate your kindness advice and contribution.

My Best Regards,