Jump to:

7938 Posts in 1540 Topics by 945 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Two DataObject within one Page

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1
Go to End
Author Topic: 808 Views
  • bunheng
    Avatar
    Community Member
    78 Posts

    Two DataObject within one Page Link to this post

    Hi,

    I would like to know is it possible to use two DataObject within one page
    I have the following code within my module

    - ResourceItem.php ---> DataObject
    - ActivityItem.php ---> DataObject
    - LocationPage.php ---> Page

    I really appreciated for your kindness advice and tutorials.

    Bunheng

  • UncleCheese
    Avatar
    4085 Posts

    Re: Two DataObject within one Page Link to this post

    static $has_many = array (
    'ResourceItems' => 'ResourceItem',
    'ActivityItems' => 'ActivityItem'
    );

    --------------------
    SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com

  • bunheng
    Avatar
    Community Member
    78 Posts

    Re: Two DataObject within one Page Link to this post

    Hi,

    How can we put in function GetCMSField() with two different DataObjects.

    Regards,
    Bunheng

  • UncleCheese
    Avatar
    4085 Posts

    Re: Two DataObject within one Page Link to this post

    new DataObjectManager($this,'FirstDataObjects','FirstDataObject')
    new DataObjectManager($this,'SecondDataObjects','SecondDataObject');

    808 Views
Page: 1
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.