Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

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

DataObjects by Page


Reply

4 Posts   343 Views

Avatar
Lazarus404

24 March 2013 at 10:38am Community Member, 71 Posts

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

Avatar
martimiz

25 March 2013 at 1:28am Forum Moderator, 1091 Posts

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

Avatar
Lazarus404

25 March 2013 at 3:10am Community Member, 71 Posts

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

Avatar
martimiz

25 March 2013 at 4:55am Forum Moderator, 1091 Posts

Hahaha - see you in another two! :)