Jump to:

7935 Posts in 1536 Topics by 943 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » DataObjectManager Code Examples

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1 2 3 4 5 6 7 8 9 10 11
Go to End
Author Topic: 20513 Views
  • vivilanco
    Avatar
    Community Member
    19 Posts

    Re: DataObjectManager Code Examples Link to this post

    sorry if i sound stupid, but what do you mean by that?

    (as an FYI i have done a new install, only modules being: SWF upload and DataObjectManager)
    I have onlu uploaded 1 file and ticked " This resource is viewable by the public "

  • UncleCheese
    Avatar
    4085 Posts

    Re: DataObjectManager Code Examples Link to this post

    You'll need to decorate the Group object by adding it in your _config.php

    DataObject::add_extension("Group","MyGroupDecorator");

    Where "MyGroupDecorator" is the name of the class you're using to extend the Group.

  • UncleCheese
    Avatar
    4085 Posts

    Re: DataObjectManager Code Examples Link to this post

    Here's an example of a decorator for the Group:

    MyGroup.php

    class MyGroup extends DataObjectDecorator
    {
       function extraStatics()
       {
          return array(
             'belongs_many_many' => array(
                'Resources' => 'Resource',
                'ResourcePage' => 'ResourcePage'
             )
          );
       }
    }

  • vivilanco
    Avatar
    Community Member
    19 Posts

    Re: DataObjectManager Code Examples Link to this post

    Thanks for the help, but i think i am stepping a little out of my depth.
    I'm ok to play with the php but i'm struggling, its on my books to learn it but as of now i consider myself a designer with html, css and coffee

    i really should put my mind to learning to write the stuff (php, javascript and ajax off my head and not just break it).

    I will have a fresh look tomorrow. thanks UncleCheese.

  • UncleCheese
    Avatar
    4085 Posts

    Re: DataObjectManager Code Examples Link to this post

    Yeah, decorators are a little tricky. Do you need the the feature of associating resources with a Group, or did you just want the hierarchy that is used in that example?

  • vivilanco
    Avatar
    Community Member
    19 Posts

    Re: DataObjectManager Code Examples Link to this post

    Group would be advantageous I won’t lie, and the potential client would find it useful, Im basically doing all this speculativly...

    Ability for some files available via public connection, and registered members ability to access others.

  • novaweb
    Avatar
    Community Member
    111 Posts

    Re: DataObjectManager Code Examples Link to this post

    Hey,

    Are there any code examples for using DataObjectManager in a Page controller? ie front end in blackcandy?

    Cheers,
    Josh

  • DanStephenson
    Avatar
    Community Member
    115 Posts

    Re: DataObjectManager Code Examples Link to this post

    Josh,

    The firs time I did that, I used the Testimonials tutorial in the DOM documentation in the Wiki, and applied it into my page template. It worked for me, and taught me what I was doing.

    20513 Views
Page: 1 2 3 4 5 6 7 8 9 10 11
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.