Installation with Tinymce

scafmac - June 5, 2007 - 21:01
Project:Asset
Version:5.x-1.x-dev
Component:Documentation
Category:task
Priority:normal
Assigned:eriksen.costa
Status:closed
Description

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:
    1. url filter
    2. inline file assets
    3. html filter
    4. 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%3D100

So 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

cirotix - June 13, 2007 - 12:01

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

Roger López - June 13, 2007 - 13:50

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

cirotix - June 13, 2007 - 14:06

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

cirotix - June 13, 2007 - 14:28

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

Roger López - June 13, 2007 - 14:35

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

cirotix - June 13, 2007 - 15:13

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

Roger López - June 13, 2007 - 15:24

can you post the relevant part of your tinymce/plugin_reg.php file?

#8

cirotix - June 13, 2007 - 15:49

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

Roger López - June 13, 2007 - 16:01

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

cirotix - June 13, 2007 - 16:19

I should have noticed it myself ! Working great now.

#11

Roger López - June 13, 2007 - 16:27
Status:active» fixed

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

cirotix - June 13, 2007 - 16:33

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

Roger López - June 13, 2007 - 16:44

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

cirotix - June 13, 2007 - 16:58

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

Roger López - June 15, 2007 - 12:59
Status:fixed» closed

#16

eriksen.costa - January 13, 2008 - 15:32
Component:Code» Documentation
Category:bug report» task
Assigned to:Anonymous» eriksen.costa

I wrote about TinyMCE's integration:
http://drupal.org/node/209509

If someone think it can be improved, please, contribute!

 
 

Drupal is a registered trademark of Dries Buytaert.