Installation with Tinymce
| Project: | Asset |
| Version: | 5.x-1.x-dev |
| Component: | Documentation |
| Category: | task |
| Priority: | normal |
| Assigned: | eriksen.costa |
| Status: | closed |
Jump to:
Not sure if this is a documentation or code issue but here goes. Installing Asset and using as root (uid=1) works for images without tinymce. Another user, using tinymce, seems to lead to tinymce encoding the filter text which when submitted, no longer works.
The trial & error installation process was generally:
- install asset to module folder - modules/asset;
- copy the asset/tinymce/drupalasset folder to tinymce plugins directory;
- editted tinymce/plugin_reg.php to enable the option in the tinymce settings - though it doesn't pick up the appropriate icon for the tinymce settings page;
- enable permissions to create assets;
- Adjust tinymce input filter; current order:
- url filter
- inline file assets
- html filter
- line break converter
After inserting image with tinymce, html created is as follows:
aid%3D1%7Cformat%3Dimage%7Cformatter%3Dasset%7Ctitle%3Dtest%7Calign%3Dnone%7Cresizable%3Dtrue%7Cheight%3D100%7Cwidth%3D100So did I miss an installation step or should I dig into the encoding question? I presume your trying to use the title and/or alt tags of the image for the filter text? Are you expecting it to be urlencoded and planning on decoding it?
The module has potential, and I'm happy to work on patches if you wanted to flesh out some of the details you are planning. I'm busy enough I don't want to work on patches that will not be used.
Cheers,
Matt

#1
Hi Matt,
I had asset working with TinyMCE. You need to turn on the flash plugin in TinyMCE and you are done. Still I think that it would be better if it works out of the box. Like Matt, I am willing to provide some patches, if I now a little bit more of the roadmap for this plugin.
cheers,
damien
#2
First of all, sorry for the much delayed reply. I've been really swamped with cleaning up the core functionality of this module.
Secondly, sorry for the complete lack of documentation for getting this installed. Here is the code that should be added to tinymce/plugin_reg.php for it to work.
<?php$plugins['drupalasset'] = array();
$plugins['drupalasset']['theme_advanced_buttons1'] = array('drupalasset');
$plugins['drupalimage']['extended_valid_elements'] = array('img[class|src|border=0|alt|title|width|height|align|name]');
?>
The important bits are the last line that lets img tags support the additional attributes. TinyMCE by default allows only a tiny subset of valid attributes and this plugin uses img tags as placeholders and the additional attributes for storage of options. I am creating a new issue for creating tinymce install documentation.
@cirotix: The tinymce plugin should not require the use of the flash plugin. The reason it works when the flash plugin is enabled is that it also adds these additional attributes.
#3
excellent. Thanks a lot rz !
I suggest that we should start some handbook pages for asset, asset_bonus, asset + tinymce and asset api. I am very much willing to contribute.
#4
Sorry rz, but it still doesn't work without the flash plugin. It is correctly inserted in tinyMCE, but if I disable/enable tiny or if I submitt the page, the asset is transformed in an img. Here is the code generated:
<p><img style="width: 290px; height: 24px" class=" asset-none" src="/asset/img/4/asset_bonus/mp3player" alt="aid%3D4%7Cformat%3Dmp3player%7Cformatter%3Dasset_bonus%7Ctitle%3DBruits%20de%20cuisine%7Cwidth%3D290%7Cheight%3D24%7Calign%3Dnone" title="aid%3D4%7Cformat%3Dmp3player%7Cformatter%3Dasset_bonus%7Ctitle%3DBruits%20de%20cuisine%7Cwidth%3D290%7Cheight%3D24%7Calign%3Dnone" width="290" height="24" /></p>Note that I have the media plugin enabled.
#5
please try using only the asset plugin and standard tinymce buttons (like bold, italic, etc..). If this fixes the problem then I will know where to look.
#6
The problem remain with the basic tinymce plugins (bold,...) and asset: the following code is generated:
<p><img style="width: 290px; height: 24px" class=" asset-none" src="/asset/img/4/asset_bonus/mp3player" alt="aid%3D4%7Cformat%3Dmp3player%7Cformatter%3Dasset_bonus%7Ctitle%3DBruits%20de%20cuisine%7Cwidth%3D290%7Cheight%3D24%7Calign%3Dnone" title="aid%3D4%7Cformat%3Dmp3player%7Cformatter%3Dasset_bonus%7Ctitle%3DBruits%20de%20cuisine%7Cwidth%3D290%7Cheight%3D24%7Calign%3Dnone" width="290" height="24" /></p>Enabling the flash plugin solve the problem.
#7
can you post the relevant part of your tinymce/plugin_reg.php file?
#8
Here it is:
<?php$plugins['drupalasset'] = array();
116 $plugins['drupalasset']['theme_advanced_buttons3'] = array('drupalasset');
117 $plugins['drupalimage']['extended_valid_elements'] = array('img[class|src|bo rder=0|alt|title|width|height|align|name]');
?>
#9
Aha!!!
my fault, i posted bad code.
<?php$plugins['drupalasset'] = array();
$plugins['drupalasset']['theme_advanced_buttons1'] = array('drupalasset');
$plugins['drupalasset']['extended_valid_elements'] = array('img[class|src|border=0|alt|title|width|height|align|name]');
?>
notice that the last line should be $plugins['drupalasset'] not $plugins['drupalimage'].
#10
I should have noticed it myself ! Working great now.
#11
Glad to hear it's working. Would you mind taking the time to write up some documentation on tinymce plugin installation. I have another issue open for all types of documentation. I am hoping that users like yourself can contribute to this modules success, which i believe will depend heavily on the documentation and usability.
#12
Yes I will. I am finishing to configure it on my dev machine and will document the process of the installation when I will install asset+tinymce on the prod machine. What is your prefered format? Should I create an handbook page ?
Btw do you accept patches? I have a very simple one for now which allow the user with the 'administer assets' to be able to see all the asset subfolder (and not only the user 1). But I have seen that you are on the process to rewrite the permission settings of the module. Do you have an ETA ?
#13
A handbook page would be great. Also a text snippet that could be included in the INSTALL.txt file.
Patches are more than welcome. Even if i dont include the patch as-is, maybe it save me some time with work i'm currently doing.
Thanks
#14
I have just created a placeholder page that I will soon start to fill with a particular focus on the configuration with TinyMCE.
Anyone is welcome to contribute:
http://drupal.org/node/151538
#15
#16
I wrote about TinyMCE's integration:
http://drupal.org/node/209509
If someone think it can be improved, please, contribute!