Jump to:

22983 Posts in 11719 Topics by 2827 members

General Questions

SilverStripe Forums » General Questions » DataObjects by Page

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
Go to End
Author Topic: 261 Views
  • Lazarus404
    Avatar
    Community Member
    71 Posts

    DataObjects by Page Link to this post

    Hey guys,

    So, I've got a DataObject I've created which I add to a page using a HasManyComplexTableField in SS 2.4. However, once I've added items to this table, those very objects show in every page. Is there a way I can make it so added items show only for that page?

    Thanks,
    Lee

  • martimiz
    Avatar
    Forum Moderator
    1035 Posts

    Re: DataObjects by Page Link to this post

    If your page has a has_many relation to these DataObjects, You'd probably better use the basic ComplexTableField, not the HasManyComplexTableField. Or the DataObjectManager for that matter

    Martine

  • Lazarus404
    Avatar
    Community Member
    71 Posts

    Re: DataObjects by Page Link to this post

    Hi Martimiz,

    Thanks for the reply.

    So, a funny thing happened. I did a search in Google about this very problem and I found an old post, about two years old or so. Guess who posted it? Me! Guess who helped me fix it? You!!! :-D

    Turned out, I simply had to replace my use of HasManyComplexTableField with the DataObjectManager and bang! It works

    Thanks again, for this time and the last ;-) I guess I need to keep track of all these nuances in one place, as I seem to hit the same problems now and again :-D

    Cheers,
    Lee

  • martimiz
    Avatar
    Forum Moderator
    1035 Posts

    Re: DataObjects by Page Link to this post

    Hahaha - see you in another two!

    261 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.