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.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Showing only related object with HasManyDataObjectManager


Go to End


958 Views

Avatar
pingu

Community Member, 75 Posts

24 March 2011 at 2:27am

Hi guys,

Does anyone know if there's quick hack to show only related objects with HMDOM?

I've got a scenario where I have hundreds of recipe entries which can be linked through ModelAdmin as "featured" on the homepage, so homepage has has_many relationship with recipes, and recipes has_one homempage.

However, to streamline the updating of the site, the administrator would like to be able to unlink straight from the homepage without going through ModelAdmin.

Using an HMDOM allows them to do this - but lists ALL the recipes in the database which they don't need, and I'd like to only display the ones which are related to the homepage.