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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

DataObjects by Page


Go to End


4 Posts   629 Views

Avatar
Lazarus404

Community Member, 72 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, 1391 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, 72 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, 1391 Posts

25 March 2013 at 4:55am

Hahaha - see you in another two! :)