Hi, I am having trouble with IMCE integration in 5*
as instructed in previous posts about this issue....
I added the following code to the Tiny Tiny Module:
/**
* IMCE Integration
*
* Adds the scripts necessary for imce integration
*/
function tinytinymce_imce () {
drupal_add_js("
function imceImageBrowser(fid, url, type, win) {win.open(Drupal.settings.basePath +'?q=imce&app=Editor|url@'+ fid, '', 'width=760,height=560,resizable=1');}", 'inline');
}
then I added:
file_browser_callback: "imceImageBrowser",
to the settings in the admin page
So far I have the browser button showing up fine but it doesn't bring up the window to let you browse and select an image.
Any help would be appreciated.
I have it all working fine in 6* but need to use 5* for this particular project due to other modules in use.
Thanks in advance
Comment | File | Size | Author |
---|---|---|---|
#4 | imce_integration.tgz | 13.18 KB | DeathClaw |
Comments
Comment #1
Steve Lockwood CreditAttribution: Steve Lockwood commentedHi fibie,
What I think may be missing is the call to the function tinytinymce_imce (). Ie you have defined it but it has not been called.
In the D6 version of function tinytinymce_theme_textarea($value), you will see that we detect whether IMCE is present and, if so, we call function tinytinymce_imce ().
You should be able to tell whether it is working by looking at the source HTML for your page - it should contain the added function:
I hope this helps. If you get it working, please send me the code!
Steve
Comment #2
Steve Lockwood CreditAttribution: Steve Lockwood commentedI have made some changes which get a little closer but does not completely solve the problem. (And I realise that my previous post was off the mark - you'd got a bit further than I thought.)
D5 does not support the "Drupal.settings.basePath" object - I got round this by simply changing it to
This gets a little further - it will open the IMCE file browser. The trouble is I can't see how to get the file browser to return a value to TinyMCE - all it lets you do is upload, delete resize etc. I think the string which invokes IMCE (?q=imce&app=Editor|url ....) is not compatible with the D5 version of IMCE but I don't know what it should be.
Can anyone suggest anything?
Steve
Comment #3
fibie CreditAttribution: fibie commentedHi Steve,
Thanks for where you have got too so far.
I tried changing the code to what you suggest but it still doesn't work for me - still nothing when I click the browse button.
Are you saying it now opens the new window for you?
Thanks again for your help
Fibie
Comment #4
DeathClaw CreditAttribution: DeathClaw commentedOk finaly it works for me :) Your module is great and i hope that'll help some people.
Both imce.module and tinytinymce.module included in archive.
I added some code from 6x version to 5x version for tinytinymce.module for imce, and some code to imce.module just like tinymce module integration.
If you've already installed tinytinymce module - u'll need 2 add "file_browser_callback: "imceImageBrowser"," at your init script (it's already in default for new installation)
Comment #5
Steve Lockwood CreditAttribution: Steve Lockwood commentedMany thanks DeathClaw - I'll take a look at your code and integrate it into my module.
Steve
Comment #6
Steve Lockwood CreditAttribution: Steve Lockwood commentedComment #7
fibie CreditAttribution: fibie commentedThanks so much guys, sorry haven't been round for much of the discussion about this after having raised the issue. This patch works great - really appreciate your help on this one - I had just been completely stumped.
Comment #8
Steve Lockwood CreditAttribution: Steve Lockwood commentedMany thanks DeathClaw, I will incorporate your patch into a new D5 version of the module (with some notes and an acknowledgement in the install.txt file). I will also post a request in the IMCE project to do the same.
Steve
Comment #9
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #10
antix CreditAttribution: antix commentedWhen I add images with this patched version of both modules, I can see them in the editor but after publishing they have the wrong url (should have another ../ at the front of src=).
Comment #11
antix CreditAttribution: antix commentedFixed by adding "relative_urls : false," to init.
Comment #12
whan CreditAttribution: whan commentedAdded "relative_urls : false," to init, but still not able to view the image & file when the page is published.
Comment #13
whan CreditAttribution: whan commentedI added "relative_urls : false," to init in tinytinymce admin settings but still not able to view the uploaded image when the page is published. the url for the uploaded image is .../.../files/images, but if the url is files/images only then the uploaded image is displayed when the page is published. I'm not knowing how to remov the ..../.../ before the files/images in the uploaded image url. Please help.
Thanks.
Comment #14
trinikrono CreditAttribution: trinikrono commentedThanks man it works fine for me.