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

Drag and drop text into the cms


Go to End


6 Posts   745 Views

Avatar
mi32dogs

Community Member, 75 Posts

1 June 2015 at 5:47pm

Hi i have a question, why can't i drag and drop text from a document or email or another website into a CMS field. i get a lot of my info in documents or email and every time i have to copy and past it into the fields, especial with a lot of data it becomes a bit annoying, you can not just drag the text into it like normal form fields.
is there ay way to make it so you can drag text into the regular CMS fields.

Avatar
Pyromanik

Community Member, 419 Posts

1 June 2015 at 10:46pm

I assume you mean the HTMLEditor.

This is because it's a rich text editor, and as such microsoft products attempt to transfer their formatting info with the text. Which leads to all sorts of problems because we all know how good microsoft are at rendering HTML (hint: terrible).

TinyMCE has a 'paste from word' button on it's toolbar - try using this instead of dropping/pasting things directly into the editor.

Every other field only accepts plain text, and as such do not maintain all the other useless gaff that comes over in 'rich text' copies.

Avatar
mi32dogs

Community Member, 75 Posts

2 June 2015 at 6:28am

Thanks Pyromanik,

No I’m not taking about the HTMLEditor, I’m talking about regular CMS fields, for example I have a locations DataObject Name, Address, Cross street City, State, Zip, Phone, description so I get a location like this:
Dillons Restaurant
15512 N Longbow Ave
Between Normandy street and Mody place
Los Angeles, CA 90048
(310) 770-2587

In most CMS’s like Drupal, Joomla, Wordpress etc.. I can just select the name and drag it into the name field and the address into the address field etc.
But in SS you cannot drag regular text into a regular field you have to select the name press Ctr+c select the field for name in the CMS and press Ctr+v.

Also in the same category in most forms the browser remembers what you put in before, if you filled in the form before and you typed “los Angeles” the first time the second time once you type the “L” Los Angeles will popup for you to select. This is also not working in SilverStripe.

Any tips on how to make this work?

Avatar
Pyromanik

Community Member, 419 Posts

4 June 2015 at 7:49am

Sounds like an issue with your browser. There's nothing special about SilverStripe or it's forms. They're just standard HTML forms.

Avatar
mi32dogs

Community Member, 75 Posts

4 June 2015 at 4:36pm

I know it is not the browser as I test everything on Chrome, FireFox and IE and it is doing the same on all of them and they work all fine with other CMS’s.

So I did some more testing and I think that it is a bug in Silverstripe, on a clean install with the basic page type it is working fine, but if you create a new page type or dataObject that has an image or a file field with has_one, you are not able to drag and drop text into any of the regular fields.

It is this in the uploadFields.js

$(document).bind('drop dragover', function (e){
e.preventDefault();
});

This disabled all drag and Drop outside of the target area.
Do you know if there is a setting to switch off the drag and drop area?

Avatar
Pyromanik

Community Member, 419 Posts

5 June 2015 at 9:26am

Patch and submit a pull request will take care of it forever ;)
http://docs.silverstripe.org/en/contributing/

It's probably best to try and discover why it was put that way in the first place (if there was a reason it may not be valid anymore, if there was no reason it should be safe to remove, if there was a reason though... perhaps there's another solution? etc, have a think).