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   362 Views

Avatar
Lazarus404

Community Member, 71 Posts

24 March 2013 at 10:38am

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

Forum Moderator, 1106 Posts

25 March 2013 at 1:28am

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

Community Member, 71 Posts

25 March 2013 at 3:10am

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

Forum Moderator, 1106 Posts

25 March 2013 at 4:55am

Hahaha - see you in another two! :)