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

DataObjectManager Code Examples

Go to End

84 Posts   31056 Views


Community Member, 11 Posts

13 April 2010 at 9:54pm

Hi UncleCheese,

I'm looking for an example that allows to show on the frontend the details of the object.
Is there anything available?

Thanks a lot in advance.


Forum Moderator, 4102 Posts

14 April 2010 at 2:43am

Edited: 14/04/2010 2:44am

Not sure what you mean?


Community Member, 116 Posts

14 April 2010 at 8:47am

Hi idefix,

I believe what you're trying to do is display all (or some) of the data that you're managing with DataObjectManager on the front end of your site?
If so, in SilverStripe you do this with a "control block" - which makes things pretty easy.

First you need to get the DataObjectSet of whatever DataObject you're wishing to display on your Page type: (Page.php, TestimonialPage.php etc)

Make sure you do this in your Page_Controller class!

function Testimonials() {
$testies = DataObject::get("Testimonials");
return $testies;

Then on your Template (, - you can display the DataObject as follows:

<% control Testimonials %>
<% end_control %>

Hopefully that's what you were after!


Community Member, 11 Posts

15 April 2010 at 9:53pm

Hi subvert,

thanks a lot, but how must the link look like to invoke the detail page?

In the backend it looks like this: http://DOMAIN/admin/EditForm/field/OBJECT/item/226/edit

My code in the ss-file is as follows and I'd like to click on one table row to get the whole information about one person

<% if Anmeldungen %>
<p style="text-align: center;"><strong>Angemeldete Teilnehmer</strong></p>
<table border="0" cellspacing="0" width="600" align="center" style="border-width: 1px; border-style: solid;">
<tr style="background-color: #a3bfdb;">
<tbody><tr style="background-color: #f0f0ff;">

<% control Anmeldungen %>
<% if Even %>
<tr style="background-color: #f0f0ff;">
<% else %>
<% end_if %>

<% end_control %>
<% end_if %>


Community Member, 46 Posts

24 July 2010 at 1:55am

Hi Unclecheese, First of all great job with all this work!

Secondly, should the resource pages work 'out of the box'?

All im trying to do is create a download page from docs uploaded in the admin section.

I have put the php in the code folder and the .ss file within my template/layouts.
Everything seems to work. Can upload files. can publish the page etc. but when going to the page there is no download 'link' as such.
Also after refreshing that page there is a JS error on the admin section and it wont go any further.
Error is here:
Would be really grateful if you could give me a hand on this as my site is almost complete :)
Many Thanks


Forum Moderator, 4102 Posts

24 July 2010 at 2:26am

What version of DOM and SS are you running? Have you seen the "Code Examples" sticky in this forum? That might be a more reliable source of example code.


Community Member, 46 Posts

24 July 2010 at 2:30am


Im using 2.4 SS and r403 of DOM.
The code im using i got from the top of this thread in your example code zip file.



Community Member, 46 Posts

16 November 2010 at 11:13pm


would really like to see this working. But apperently it doesn't for me. I'm using r511 and SilverStripe 2.4 (just downloaded)

I extracted the examples from the top of this post and put the php files in the /mysite/code folder and the .ss files in /themes/mytheme/templates/Layout

I can create a Testimonial site but all it gives me is a blank page in the middle and no errors show up, even though 'dev' mode is used.....

Any help???


Go to Top