Closed (fixed)
Project:
Scald: Media Management made easy
Version:
7.x-1.x-dev
Component:
Library/DnD
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
30 May 2013 at 07:42 UTC
Updated:
1 Jun 2014 at 08:20 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jcisio commentedCurrently you can't, because block does not use text field (at least in D7, in D8 it won't be a problem with the block_custom module) and Scald only works with fields. So you will need a "Scald filter". That should not be too difficult to implement.
Comment #2
duneblMany thanks for your so quick answer!
If I understand you well, using
will not help me because blocks are not made of 'text_long' field.
Could you let me know what is a "Scald filter"... do you mean an input text filter?
Don't you think having blocks using scald as well would be a nice feature?
Thanks again
Comment #3
jcisio commentedYes. And yes, it would be a nice feature.
Comment #4
jcisio commentedAlso, you might want to try Bean Scald. Bean is better Block.
Comment #5
duneblYou are the boss!!!
I will try it tomorow and will provide my feedback here as I have to leave right now
Comment #6
duneblBean Scald
Here are the conclusions of my testing of "Bean Scald":
You can use this module if you want quickly a block type that is supporting Scald... (features and beans are dependencies) but you need to add a text field yourself.
Without using "Bean Scald":
For those who don't knew the bean module like me, this is the solution: just install/enable it and you will be able to create your own block type and then add fields that are supporting DnD of scald media.
It was what I was waiting for!
Thanks you!!
Comment #7
jcisio commentedComment #8
mavin commentedHello,
The attached patch activates the drag and drop library for native Drupal blocks, so that you can add atoms in your blocks.
Comment #9
dDoak commentedHi,
Any feedbacks on this patch? At least, it works for native blocks.
Thanks
Comment #10
discipolo commentedconcerning bean scald actually there is a text field and a Atom Reference field. i am just not getting additional contexts to work.
Comment #11
discipolo commentedthis patch applies cleanly and performes as advertised! i am experiencing issues when deleting atoms that were inserted into blocks though, will investigate deeper
regrettably contexts passthrough an imagestyle for youtube videos doesnt work for me here either. but that is a seperate issue.
Comment #12
jcisio commentedWell, it is not a format filter. However, it's a very nice patch that proves how easily integrate Scald DnD into a block. Needs work because it bypasses the access control (per #11), or it goes into a Scald extras or Scald block modules, with those known limitations.
Comment #13
henrikakselsen commented#8 seems to work fine, haven't got any issues so far.
Comment #14
davidhk commentedThe patch adds a basic input filter that can be used to convert SAS to HTML.
Comment #15
jonesui commentedThis patch is working for me (with a minor caveat: https://drupal.org/comment/8663319#comment-8663319).
Comment #16
jcisio commentedAdd a description about the security implication and best pratices to use it, then I think it is good to go.
Comment #17
davidhk commentedIf I make this change to documentation page https://drupal.org/node/1775718, will it be ok?
I don't understand the security risks of switching to use a filter, please can you explain?
Regards, David
Using a textarea field
First you'll want to allow users to embed atoms into the text.
on (primary) atom copyright expiration etc.)
Enable the DnD option, and optionally the MEE option.
Now when a user edits the field, they can use the Scald library browser to select and embed atoms into the text.
Displaying embedded atoms in a textarea field
After editing and saving the text, any embedded atoms are stored as tokens in the SAS text format. At display time, these tokens must be converted back to a rendered atom. If you enabled "Drag'n'Drop Enabled" for this field, the conversion happens automatically. This conversion happens after all of Drupal's filters have run.
It is recommended that you disable the "Convert URLs into links" filter for any text formats that will be used with this field. Otherwise the SAS tokens may be altered, potentially preventing their later conversion to rendered atoms.
But I must use the "Convert URLs into links" filter
You have the option to convert SAS tokens to rendered atoms using a filter. Edit the text formats that will be used for this field, and in the "Enabled filters" section, make sure that "Convert Scald SAS to HTML" is selected.
Then in the "Filter processing order" section, make sure that the "Convert Scald SAS to HTML" filter is executed before the "Convert URLs into links" filter.
Comment #18
davidhk commentedComment #19
jcisio commentedSeveral security problems:
- Filter cache must be disabled unless you don't want to do control access.
- Generally, the Scald filter should be executed last, because it generate a lot of markup and sensible HTML tags (picture, iframe, noscript etc.). The "Convert URLs into links" filter is usually the first one to be executed, before any HTML clean up. So, in this use case, if you want to run Scald filter before "Convert URLs into links" filter, it may work for some simple provider (image with simple markup), but not all.
The more I think of it, the more I lean towards creating a separate scald_filter module that people could enable if they want, then if that filter is enabled for a text format, then attach the library to it. With this module enabled, you can bypass the MEE module and its field based approach.
If you can't create a full project, I can create one and add you as co-maintainer.
Comment #20
davidhk commentedThanks for the explanations. So after the above documentation, I'd add:
I agree with the alternative module to MEE you describe, but sorry, I don't have the ability or time to handle a project. I'm learning just enough to get my migration finished, but then will go back to running the site. If that means the change can't make it in to Scald, I understand and will just use the code locally.
Regards, David
Comment #21
jcisio commentedThis issue has attention from many people so that I went ahead and created https://drupal.org/project/scald_filter. Further discussion will be there.
@davidhk I've added you as co-maintainer of that module so that you don't have to wait for committing stuffs that are useful for many people. Of course if you don't want it, I'll remove.