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

Dataobject_manager SortableDataObject::add_sortable_many_many_relation


Go to End


2 Posts   2681 Views

Avatar
NETim

Community Member, 24 Posts

15 April 2013 at 11:10pm

Hi,

Trying to apply drag and drop sort ordering to a site.

We have Products (DataObject) which have a many_many relationship with CategoryPage(Page types).

The relationship works fine, apart from sort ordering. We have used the directive:

SortableDataObject::add_sortable_many_many_relation('CategoryPage','Products');

To try and add drag and drop sort ordering to the categoryPage administration, so the end user can reorder products in a category.

When we add the directive to the _config.php, a dev/build shows that the sort order column has been created, but there are no changes in the admin. It appears that the directive is being ignored.

Any ideas guys?

T

Avatar
UncleCheese

Forum Moderator, 4102 Posts

18 April 2013 at 12:45am

Look closely at the argument signature for that function. The first parameter is the class where many_many is defined, and the second is the name of the many_many relation.