Jump to:

7919 Posts in 1358 Topics by 932 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Preview: DataObjectManager module

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w

Go to End
Author Topic: 54669 Views
  • Aram
    Avatar
    Community Member
    598 Posts

    Re: Preview: DataObjectManager module Link to this post

    Hey drye thanks for the link, that looks pretty good! Not sure about the font though ;)

  • Howard
    Avatar
    Forum Moderator
    215 Posts

    Re: Preview: DataObjectManager module Link to this post

    Got it working well! Thanks heaps for all your recent work UncleCheese.

    I am using this module to create a website planning page that we can use with new clients. Just a couple of questions:
    1: How would I go about getting an email sent whenever a new dataobject is added? ie, if they add an document to a page it sends me an email letting me know.

    2: Is there a way to have the date set in the popup automatically to 'Todays' date so we can order additions by date added? I tried:

       
    $todaysdate = date('d/m/Y');
          return new FieldSet(
             new CalendarDateField('Date', 'Date', $todaysdate),


    But it didnt seem to work - date field remained blank

    3: I have a FileDataObjectManager and a DataObjectManager on the same pagetype on different tabs, how can I set different things for the manager of each ie:    $manager->setPluralTitle('Documents'); for one and $manager->setPluralTitle('Comment'); for the other?

    Cheers,

    Howard

  • NickJacobs
    Avatar
    Community Member
    144 Posts

    Re: Preview: DataObjectManager module Link to this post

    Just wanted to say thanks for all the work on this module.... I found it just in time to use in a couple of current projects and it has really made the difference between an average backend workaround (read hack!) and a system that really adds value to a clients website. Thanks to UncleCheese & everyone else!

  • UncleCheese
    Avatar
    4085 Posts

    Re: Preview: DataObjectManager module Link to this post

    @Tsunami - Thanks so much for the feedback. I'm putting together a list of testimonials about the DataObjectManager and ImageGallery. I'd like to use that if you don't mind.

    @howard -

    1: How would I go about getting an email sent whenever a new dataobject is added? ie, if they add an document to a page it sends me an email letting me know.

    ==> This is a little tricky. You have to use the onBeforeWrite() hook in the DataObject class.

    class MyObject extends DataObject
    {
    function onBeforeWrite()
    {
    if(!$this->ID) {
    // Do email notification
    }
    parent::onBeforeWrite();
    }
    }

    2: Is there a way to have the date set in the popup automatically to 'Todays' date so we can order additions by date added?

    ==> Nice catch on this one. The DataObjectManager popup is designed to sniff out CalendarDateFields and substitute them with DatePickerField (jQuery based). In that process, it was only feeding the name and title to the DatePickerField. I've added Value to that, as well. Also, I've updated DatePickerField to default to today's date, and it is now a readonly field.

    3: I have a FileDataObjectManager and a DataObjectManager on the same pagetype on different tabs, how can I set different things for the manager of each ie: $manager->setPluralTitle('Documents'); for one and $manager->setPluralTitle('Comment'); for the other?

    ==> Provided each DataObjectManager is stored in different variables, this should not be a problem.

    $manager1 = new DataObjectManager(....);
    $manager1->setPluralTitle('foo');

    $manager2 = new DataObjectManager(...);
    $manager2->setPluralTitle('bar');

    They should be self-contained objects. Let me know if that's not working for you.

  • drye
    Avatar
    Community Member
    49 Posts

    Re: Preview: DataObjectManager module Link to this post

    @UncleCheese I have to say again NICE WORK. I am using the ImageDataObjectManager and it doesn't seem to have the drag reorder option enabled. Am I missing something simple? At first I thought I needed your other extension SortableDataObject, but then I saw this quote from you: "Also, SortableDataObject is obsolete since it has been merged into the DataObjectManager extension." Please let me know if I am missing something, or if there is a reason that the ImageDataObjectManager can't do the drag and drop sorting.

    EDIT: Never mind... After watching a little more closely your youTube video steered me in the right direction. THANKS! In the _config.php of the dataobject_manager I had to add:SortableDataObject::add_sortable_class('ImageShowItem'); I suppose I could also put them in the mysite/_config.php

    Thanks again!

  • UncleCheese
    Avatar
    4085 Posts

    Re: Preview: DataObjectManager module Link to this post

    You are missing something. Lucky for you, I just put the docs up.

    http://doc.silverstripe.com/doku.php?id=modules:dataobjectmanager#activate_drag-and-drop_sorting

    Edit: Looks like you got it. Yes, it is probably more appropriate to put that in mysite/_config.php.

  • Anonymous user
    Avatar
    Community Member
    1 Post

    Re: Preview: DataObjectManager module Link to this post

    Thanks again, this is still the best and most needed extension to have come out!

  • drye
    Avatar
    Community Member
    49 Posts

    Re: Preview: DataObjectManager module Link to this post

    With the added documentation, I have to say that the DataObjectManager Module is the most useful extension to date. UncleCheese has out done himself.

    54669 Views
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.