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

DataObjectManager Code Examples


Go to End


84 Posts   40578 Views

Avatar
UncleCheese

Forum Moderator, 4102 Posts

21 May 2009 at 2:40am

Edited: 21/05/2009 2:40am

I have had a lot of requests for the code examples from the original DOM tutorial. These have since been removed from the SVN channel because people were complaining, rightfully so, about all of the extra page types it was creating. For reference, the original code and templates are here:
<br >
<br >http://www.carlinowebdesign.com/assets/dataobjectmanager_examples.zip

Avatar
lxer

Community Member, 16 Posts

11 June 2009 at 9:51pm

and add this to ResourcePage.php to get it working:

class ResourcePage_Controller extends Page_Controller {
}

Avatar
UncleCheese

Forum Moderator, 4102 Posts

12 June 2009 at 2:27am

Thank you! I'll add that in.

Avatar
UncleCheese

Forum Moderator, 4102 Posts

12 June 2009 at 2:29am

Actually, I just had a look and it's already there. Am I missing something?

Avatar
UncleCheese

Forum Moderator, 4102 Posts

30 June 2009 at 6:29am

Avatar
stevanovich

Community Member, 63 Posts

18 August 2009 at 9:01pm

Hi Uncle Cheese thanks for the great work done on Gallery and DataObjectManager. I am currently using both which are fine. I have a request. I am using the resourcepage example which is working fine. I have put catergories in CMS and want to split the PDF datasheets into these categories on the site itself. How would I go about doing this?

Steve

Avatar
UncleCheese

Forum Moderator, 4102 Posts

19 August 2009 at 1:40am

I've explained this a number of times. I think it definitely belongs in a sticky.

Try this..

MyResourceHolder_Controller extends Page_Controller
{
function category()
{
$resources =  DataObject::get("MyResourceObject","Category='".$this->urlParams['ID']."'");
if($resources) {
return $this->customise(array(
'Resources' => $resources,
'CategoryTitle' => $this->urlParams['ID']
));
}
return false;
}
}

/my-resource-holder/category/foo

MyResourceHolder_category.ss
$CategoryTitle
<% control Resources %>

<% end_control %>

Avatar
stevanovich

Community Member, 63 Posts

20 August 2009 at 4:31am

Thank you my good man. Will get this up and running in no time.

Go to Top