5121 Posts in 1527 Topics by 1119 members
| Go to End | Next > | |
| Author | Topic: | 2804 Views |
-
Adding Drag & Drop functionality in Backend

16 November 2010 at 6:09am
Hi.
I have set-up a gallery using "getCMSFields_forPopup".
For sorting I'm using a integer text-field called "position", but this is not very comfortable to maintain.
Is it possible to let the admin sort the pictures using drag&drop?
Thank you!
Sam
-
Re: Adding Drag & Drop functionality in Backend

17 November 2010 at 12:06pm
hi
if you use DataObjectManger you could add a sortable option to it. have a look here
http://ssbits.com/snippets/2010/a-data-object-manager-cheatsheet/ -
Re: Adding Drag & Drop functionality in Backend

17 November 2010 at 11:41pm
Thank you lerni.
Unfortunately this doesn't work. I read that "SortableDataObject" is not usable for the backend.
http://doc.silverstripe.org/modules:sortabledataobject
"The sorting takes place not in the CMS, but rather on the front end for logged in administrators."
Or didn't I get this right?
Cheers,
Sam -
Re: Adding Drag & Drop functionality in Backend

18 November 2010 at 1:18am Last edited: 18 November 2010 1:21am
heho
whith DOM it certainly is usable in the backend - never used it in the frontend. just add the option in your _config.phpdo a .../dev/build, log back in to to backend and your done!SortableDataObject::add_sortable_classes(array('YourObject'));
-
Re: Adding Drag & Drop functionality in Backend

18 November 2010 at 2:19am
Well, I can see the "Allow drag & drop reordering" checkbox, but it doesn't change a thing when being checked.
Additionally the list is not a table anymore (I changed the object from ComplexTableField to DataObjectManager).Plus the backend assets Management now claims "Error: DataObjectManager requires the Uploadify or SWFUpload modules.", after putting "modules-dataobject_manager-r511" into the root-dir.
I'm too dumb obviously...
-
Re: Adding Drag & Drop functionality in Backend

18 November 2010 at 2:27am
heho
Do you have DataObjectManager installed an named the directory like "dataobject_manager"
DOM = DataObjectManager
http://www.silverstripe.org/dataobjectmanager-module/ -
Re: Adding Drag & Drop functionality in Backend

19 November 2010 at 10:48pm
Thank you learni! This was the right hint! The directory-name was wrong. Drag-&-Drop-sorting now works like a charme.
Unfortunately I still get the "Error: DataObjectManager requires the Uploadify or SWFUpload modules." when choosing the assets-management "Files & Images". Do you have an idea?
Sam
-
Re: Adding Drag & Drop functionality in Backend

19 November 2010 at 11:33pm Last edited: 19 November 2010 11:33pm
hi sam
it basically means what it says - you have to upload/install Uploadify or SWFUpload ;-)
newer versions of DOM work with Uploadify older with SWFUpload. http://www.leftandmain.com/silverstripe-modules/2010/08/26/uploadify/
if you wana turn-off DOM for assets you can add the following to your _config.php
DataObjectManager::allow_assets_override(false);
| 2804 Views | ||
| Go to Top | Next > |


