This module depends on TinyMCE, but i want use Wysiwyg API module.

Comments

carlitus’s picture

Status: Active » Postponed

It's a good idea. I don't know when but i'll do it.

manuel garcia’s picture

Totally second this feature request... Wysiwyg API is the future !

Tthis module would then work with all the editors that work with the API, definitely the way to go ;)

hankpalan.com’s picture

+1 for WYSIWYG API support -

I just changed out TinyMCE module for the WYSIWYG API, because TinyMCE is dead. But this module is the perfect solution I've been looking and waiting for. But I don't want to go back to a dead module...

niklp’s picture

This module MUST MUST MUST be given WYSIWYG.module support, or it is utterly useless.

Do that now!

Anonymous’s picture

To use Easy Image Insert with WYSIWYG API just edit easy_image_insert.info and comment (add a ;) line 7:
dependencies[] = tinymce. This way Easy Image Insert works perfectly with WYSIWYG Api module.

To align the inserted image just use the custom css style plugin.

Anjaro’s picture

Yes for WYSIWYG.module support.

I see many post from people looking for a solution like this, while i myself was searching.

Thanks

niklp’s picture

jmesam: Your post is encouraging - I think it would be helpful if you detailed how you configured the CSS plugin to allow for such measures!

marcvangend’s picture

This is a great module, 'official' support for the wysiwyg api would be great, but for now the workaround in #5 will do just fine.

NikLP, I just posted a patch that makes applying css easier in #381562: Add classes for automatic styling.

aleagi’s picture

Hi,

I'm working with the latest versions of EII and WYSIWYG modules.

I inserted the comment in line 7 of .nfo file and everything looks fine, except for one thing.

The image is uploaded by the image filed as expect bu I cannot insert the image on the text.

Is there anymodifications needed on WYSIWYG or TinyMCE to make it work?

Any help will be appreciated!

Thanks in advance!
Aleagi
@:)

marcvangend’s picture

Aleagi, I didn't make any modifications to WYSIWYG or TinyMCE, but it works for me. Which versions are you using?

alan d.’s picture

The JScript code has a line that looks for a parent table element of the image and does not try to find the right element to pull the id from:

id_table = $('#' + id_image).parents('table').attr('id');

A quick hack got it working (sorta)

//id_table = $('#' + id_image).parents('table').attr('id');
image_alt = ''; //$('#' + 'edit-'+id_table.substring(0,id_table.lastIndexOf('_')).replace('_','-')+'-'+key+'-data-alt').val();

Using Drupal 6.10, CCK 6.x-2.1, ImageField 6.x-3.0-beta1, WYSIWYG 6.x-2.x-dev (8 March 2009), there are no tables to be seen in the HTML

Hope it helps

aleagi’s picture

Hi there,

Sorry for the delay, kind busy in other projects!

Well, solution #11 works really smooth! THANKS! @:)

alan d.’s picture

StatusFileSize
new5.53 KB
new35.26 KB

I'm using this module for the first time on a fairly large project, and I done a lot of work to port the code into the FAPI for a number of reasons not directly related to the core functionality of the module, but for ease of possible extensions that we'll be looking at latter.

It has fairly limited testing, the supplied code should be considered an early alpha release!

I AM NOT RELATED TO THIS PROJECT. THE CHANGES HERE ARE FAIRLY MAJOR AND HAVE NOT GONE THROUGH ANY OF THE MAINTAINERS. IT IS SUBMITTED FYI ONLY!

Change to the variable storage

eii_TYPE_active > eii_active_TYPE

Added the following settings

  • eii_base_directory
    Three options for base directory handling:
    • Relative. Eg: files/imagecache/...
    • Drupal base_path, the existing method. Eg: /files/imagecache/...
    • Internal path filter. Eg: internal:files/imagecache/...
  • eii_preset_name_options
    Options to tidy up the imagecache preset names:
    • Y/N Replace underscores with spaces.
    • Y/N Uppercase the first letter.
  • eii_attributes_wrapper_classes
    Class for a wrapping DIV element, named "Wrapper".
  • eii_attributes_anchor_classes
    Class for the anchor (A) element, named "Class".
  • eii_attributes_anchor_rel
    Rel attribute for the anchor, named "Trigger".

Administration area

  1. Enabled checkbox moved to identity fieldset on edit content page.
  2. New admin page created
    • Enable/Disable all content types from one location, checkboxes.
    • Radios for base directory handling selection
    • Checkboxes for ImageCache preset name options.
    • Textarea fields for the Wrapper, Class and Trigger attributes.

Refactored the form elements that are embedded into the imagefield element

This was the biggest change, from HTML into a custom FAPI element. Most likely location for missed bugs!

Presentation changes

Totally removed all custom styles. It is all native Drupal / theme.

Moved the Textarea, Preset, Link fields into a collapsed fieldset, along with the new Wrapper, Class and Trigger fields. See the attached screenshot.

Reasons:

1) The styles now automatically merge into the themes native styling.

2) Space was an issue, the elements were pushing content to far down the page (Out site has many pages with 20+ images)

3) The Insert and Remove buttons were simply to close together. I hit the remove button at least once by mistake.

JavaScript changes

The next most likely place for bugs to be introduced.

The hidden SPAN elements are converted into hidden INPUT elements

The ALT and TITLE have been fixed for the latest WYSIWYG / ImageField modules

New fields have been hooked into the JavaScript.

Major outstanding issues

There is NO sync. with the actual WYSIWYG editor that has been set. The "Textarea" select lists all textareas, not just the textareas that have TinyMCE attached.

The internal path filter lacks a preview state. The img src of "internal:files/.." just can not work in the Editor!

alan d.’s picture

StatusFileSize
new6.39 KB

Refactored things a bit to fit with the WYSIWYG module.

All imagefield widgets get the new eii_option_fields elements, and the form gets the eii_process_form #after_build callback attached. The after build function expands the field depending on the imagefield and format settings of the field in question

This should mean that any field that has an input format assigned to it should now be picked up (untested), just like the WSIWYG module.

The JScript can handle insertion into the tinymce and default editor 'none' (Eg: the simple textarea / disabled state). Additional editor support should be fairly simple, just add then into the case statement near the end of the JScript file. Hoping that an interface via the WSIWYG to eliminate the need to support editors here. @ref http://drupal.org/node/409938

Latest code attached.

confudler’s picture

I get this error:

WYSIWYG API has changed. Please check for more up to date modules or lodge an issue at Drupal.org with Easy Image Insert

Any ideas?

alan d.’s picture

Can you let me know exactly what versions you are running.

My setup was for the project that we are working on which are:

drupal 6.10
imagefield 6.x-3.0-beta3
wysiwyg 6.x-2.x-dev (Mar 28)

But I'm happy to help making it more generic.

Anonymous’s picture

I don't get any error, but the picture doesn't insert in the textarea, and the imagefield widget display "array".

drupal 6.10
imagefield 6.x-3.0-beta3
wysiwyg 6.x-2.x-dev (Mar 28)

alan d.’s picture

A few questions:

Did you remember to flush your cache? The jscript file has changed and a couple of theming functions have been added.
Have you got imagecache enabled?
Did you use the file from #14?

If you still have issues, let me know.

Please remember that this is simply my hack of the existing module into the world of the FAPI, and doesn't reflect the real module.

confudler’s picture

Thanks for the rapid response

I'm using Drupal 6.10
I have upgraded filefield/imagefield from alpha to the latest beta but the error persists.
I tried WYSiWYG 6.x-2.x-dev : this gave the same error, I have since reverted to the stable v1

I have flushed the cache and I am using the version from post 14

alan d.’s picture

StatusFileSize
new6.5 KB

Duh. The project that we were working on had 2 textareas, and a single textarea was the only combo that I hadn't tested at least once.

The attached version should hopefully work, but still needs work. I'm using a custom element to render all of the elements that are used in EII part of imagefield, similar to what wysiwyg does (in the #after_build callback), but still has issues with the setting of names/ids on the fields.

Let me know how you get on.

confudler’s picture

OK, that worked. Now I have a new problem.

I can insert originals just fine, but the link to thumbnails (which I rather confusingly called gallery) outputs

/drupal-6.10/sites/default/files/imagecache/gallery/sites/default/files/brushes.gif

When I need it to output:

/drupal-6.10/sites/default/files/imagecache/gallery/brushes.gif

or even better:

/drupal-6.10/sites/default/files/imagefield_thumbs/brushes.gif

hmm

alan d.’s picture

I didn't hook into the imagefield thumbs - are these meant to be used outside imagefield? Please supply some info on the status of these fields.

The link options should be just "Original" or "Original" + 1 option for every ImageCache preset that you have defined. The "gallery" must be one of these?

Image cache works using the URL "files/imagecache/[ImageCache preset]/[files directory]/[path to image within file directory]", guessing this may not be working? The config. gives 3 options for this

Prefix this path with nothing - works without clean URLs, or if BASE HTML is set in the template
Prefix with the Drupal base path, '/drupal-6.10/', required for clean URLs with no BASE set
Prefix with internal: - integrates with internal path filter, but looks like crap as there is no preview state in the wysiwyg editor

Anonymous’s picture

Now it works perfectly, but when I reedit the post display twice and the title and alt attributes displays "undefined". Edit: The text also displays duplicated

Thanks

confudler’s picture

Ah, no, I see now.

What I really want to do is replace

drupal-6.10/sites/default...
with
drupal-6.10/?q=sites/default...

If only I knew some basic JS to rewrite that string

alan d.’s picture

Can you clearly explain this: "but when I reedit the post display twice"

The newer version adds some error checking on alt / title

alan d.’s picture

StatusFileSize
new6.69 KB

Added automatic "?q=" to all imagecache presets

Moved to a generic WYSIWYG insert that falls back to a generic HTML insert. It shouldn't matter what editor you use, as long as it implements the 'insert' function

Anonymous’s picture

I'm sorry I meant: when I reedit the post, the picture displays twice. Everytime I visit the node edit form, everything get duplicated.

alan d.’s picture

StatusFileSize
new6.69 KB

Missed one of the bug fixes that I submitted from work.

K, dropped all of the TinyMCE specifics, thinking that these may have been the cause. I've got "clean up html" option enabled in wysiwyg.

confudler’s picture

OK, I'm getting there. I have got it working but not if it tries to insert an original image (as opposed to an imagecache one).

I tried to change the default on line 244 but it doesn't work. Can you help?

N.B. this is an intranet site so it doesn't have to be perfect!

Anonymous’s picture

Every time I edit & save, a new copy of the content is created. I have edited & saved 10 times, now the post has 10 copies of the picture and 10 copies of the text. It seem like every time I save the content, the module insert it again.

Using Easy Image insert #28 version and WYIWYG api March 27th version.

alan d.’s picture

@confudler Have you had a play with the Base directory handling settings?

Since you asked for the "?q=", you must be running without clean urls? The imagecache ones will be "?q=files/imagecache/..." and the original will need to be "/drupal-10/files/images/..."?

Here are the results of my tests, inserted via the TinyMCE editor, clean URL's disabled, base directory handling settings set to "Prefix with base path."

<img class="mceItem" title="test title" src="/base/files/node-images/test.jpg" alt="test alt">
<img class="mceItem" title="test title" src="/base/?q=files/imagecache/page_thumb/files/node-images/test.jpg" alt="test alt">

If these do not work in the editor, do they work once they are saved?

@jmesam

I simply can not even get close to replicating this. A couple questions / tasks:

Can you paste the following, wrap in HTML code tags to ensure that these show up here:

The disabled HTML (toogle the editor to show this) from insertion.

The disabled HTML after you have saved and tried to reedit the page.

Also, can you disable the EII from showing on the content type and try to see if this still happens.

Cheers guys

Anonymous’s picture

Thanks for your tips, it was inline module, I disable it and everything works ok.

avpaderno’s picture

Status: Postponed » Closed (won't fix)

The module has been declared deprecated.