Jump to:

22996 Posts in 11620 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » DataObjects Per Page Instance

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1 2
Go to End
Author Topic: 1838 Views
  • martimiz
    Avatar
    Forum Moderator
    1035 Posts

    Re: DataObjects Per Page Instance Link to this post

    I would try and use the default DataObjectManager instead, as that will correctly define a direct relation between an individual Page and its DataObjects.

    Hope that helps

  • martimiz
    Avatar
    Forum Moderator
    1035 Posts

    Re: DataObjects Per Page Instance Link to this post

    OK - just saw your latest post fly in If the correct PageID is set in the DataObject, then how are you retrieving your dataobjects for your Page in the frontend?

  • Lazarus404
    Avatar
    Community Member
    71 Posts

    Re: DataObjects Per Page Instance Link to this post

    Not entirely sure. It's only showing the one, as I've not added new items yet. I think it may be because I haven't added any items for that particular page (or I'm hoping). Still, even if that side really works, I'm still getting ALL dataobjects in the admin. The items now have checkboxes, so I can choose what to include on the current page, but what I really want is to not see those items created in the other page at all. Do you think that's possible by filtering somehow in the getCMSPopup function?

    Thanks,
    Lee

  • martimiz
    Avatar
    Forum Moderator
    1035 Posts

    Re: DataObjects Per Page Instance Link to this post

    Still not absolutely clear about what you're asking. Is your question really about the way the dataobjects are shared among pages within the cms? In that case: did you try using the regular DataObjectManager instead of the hasmany variant? Cause the regular one will display only those DataObjects that belong to your page as I guess you want...

    if its about the way they are displayed on your website, The answer most likely lies in the way your template is set up, but you didn't respond to that so I figure that's not the problem?

  • Lazarus404
    Avatar
    Community Member
    71 Posts

    Re: DataObjects Per Page Instance Link to this post

    Yes I mean CMS.

    I tried changing it, but the same still held (albeit with a different look and feel). The objects need a HTML editor in the popup, so I really need the DataObjectManager module for these.

    Thanks,
    Lee

  • martimiz
    Avatar
    Forum Moderator
    1035 Posts

    Re: DataObjects Per Page Instance Link to this post

    I still think (in fact I'm sure) the problem lies in your (initial) use of the HasManyDataObjectManager. The following will indeed give you the same look and feel, but will limit the display of DataObjects to the page they belong to:

    $contentTablefield = new DataObjectManager(
    $this,
    'PanelItems',
    'PanelContent',
    array(
    'Title' => 'Title',
    'Group' => 'Group Name',
    'Content' => 'Content'
    ),
    'getCMSFields_forPopup'
    );

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