Closed (fixed)
Project:
IMCE
Version:
6.x-1.2
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
22 Sep 2009 at 20:46 UTC
Updated:
15 Oct 2014 at 17:32 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dsms commentedHi,
I had a the same problem with my own template and I can at least tell you why this issue occurs and which workaround I used.
When some JavaScript from your Template and some JavaScript from IMCE use the same function names, namespaces or act on same DOM-nodes, something crashes, like the options bar.
So, it is very likely that your specific theme includes a certain JavaScript that interferes with the IMCE JavaScript files.
Your template defines it's JavaScript files that it want to use in it's themename.info file and it is loaded by calling drupal_get_js()
in sites/modules/imce/tpl/imce-page.tpl.php
so, two things you can do now: find out what particular JavaScript file from themename.info causes the conflict, remove this
entry from themename.info, go to the head section of your page.tpl.php and add the JavaScript reference by hand.
(use Firebug and disable the included js-references one by one)
that would probably be the best solution.
what I did is: change to a working theme (e.g. garland), open IMCE (that should work for the moment), open the HTML source
and copy the head-section, paste it into imce-page.tpl.php and removed all unnecessary CSS and JS references.
this should be done very carefully, because IMCE pushes some settings to jQuery.extend-Drupal.settings that might be
user-sensitive.. so I would not recommend this if you use IMCE with different profiles.
to the IMCE people I would recommend, to hardly reconsider if drupal_get_css and drupal_get_js make sense in imce-page.tpl.php
because there is no need to include theme-specific stuff and as you see, it causes only problems.
so probably it would be a good idea to find another way to propagate the IMCE js+css to the template-files OR you switch
to a working admin theme (e.g. garland) for IMCE. Admins (like me) who only have a custom frontend-template use always
a drupal standard theme as admin theme, so it would be a good idea to use the admin-theme (if enabled) for IMCE too.
Comment #2
_teseo_ commentedI've been trying it like you did it, and appears delete button, but then other things don´t run correctly, like select files, or Send to FCKEditro. I'm going to attach imce.page.tpl and acryilic.info, and paste head of html source of imce working with garland theme, for you can see it, and tell me about.
Sorry for my poor english, and thanks for all.
HTML Sorce with Garland Theme
Comment #3
dsms commentedtry this one:
Comment #4
ufku commentedIt's probably script.js of the theme that is removing some buttons which IMCE converts to tabs.
I could help identifying the problem if it were implemented using jQuery.
Comment #5
_teseo_ commentedI´ve tried that dsms told me, but nothing, appears buttons, but all is wrong and not run.
ufku, and how can I know if it is implemented using jQuery? What do you need to help me? some file?
I need fix.
Thanks
Comment #6
dsms commentedyou could also try the following:
go into your acrylic.info and put a ; at the front of line 'scripts[] = script.js' so
that it looks like '; scripts[] = script.js'
go into all template files that begin with 'page' (in the acrylic from drupal.org that would be page.tpl.php, page-blog.tpl.php, page-node.tpl.php and page-node-add.tpl.php)
modify the lines
to
then you need to go to the theme-section in your backend and hit the save button.
see what happens ;)
Comment #7
_teseo_ commentedThanks for your help.
I've done everything you have told me, but nothing changes. Buttons don't appear.
another idea?
Thanks for your help again.
Comment #8
ufku commentedFound out that acrylic and other artisteer themes change button markup from input to button.
In your template.php
find
and change into
Comment #9
dsms commentedI can confirm that, Zen does it likewise. but despite the links appear as buttons, they are at least present. I'm not sure if this is really the problem here.
Comment #10
_teseo_ commentedPerfect!!! It runs!!!
Thanks for all, dsms & ukfu! Thank you very much! really thanks!
Comment #11
codewatson commentedSame issue of missing buttons with a different theme. The way we found around it was to use the ThemeKey module to have it switch to a different theme when showing the imce browser window (gave it a path of imce, so anything that was http://www.yoursite.com/imce* would load the garland theme). Probably not the best solution but ended up being the easiest to do without mucking through other js files.
Comment #12
ufku commentedComment #14
jweowu commentedhttp://drupal.org/project/admin_theme allows for a similar solution.
Just enter
imce/*as a pattern to use the admin theme on.Comment #15
smokefree commentedHow was this finally resolved? Did someone make a change to IMCE or is it necessary to patch Artiseer themes? I'm thinking of using Artiseer, and want to know if I'm going to have trouble, and if so how to get around it. Thanks in advance!
Comment #16
jweowu commentedsmokefree: It's not a problem with IMCE, and you don't need to patch anything. Use one of the other contrib modules mentioned so that you can use a different theme for the IMCE windows. I'd suggest using Garland -- unsurprisingly it works very well :)
See comments #11 and #14
http://drupal.org/project/themekey
http://drupal.org/project/admin_theme
Comment #17
TimeBandit commentedI ended up using this technique for a troublesome RootCandy issue. It resolved the problem and now I can see the "send to" stuff as usual. Related comment.
Comment #18
roxy317 commentedI use Artisterr and have had no problems with IMCE ... works great!
Comment #19
anasynth commentedI had the same symptoms described here (missing buttons in the imce interface) with the Energetic theme. Again the only buttons visible were "upload" and "send to". I just wanted to say that I tried the solution from #8 and it seems to have worked perfectly for me. I just added the if statement directly under the first line of the function (ignoring the rest of the function).
Thanks ufku!
Comment #20
I am learning commentedThanks ufku your comment at @ #8 fixed my problem.
I had the same problem, I'm using Jaded theme, I could fix the problem by your approach. in my template.php, the function jaded_button($element) {
I added
if (arg(0) == 'imce') return theme_button($element);
and voilla, it worked.
Comment #21
swill commentedI had this issue on my own custom theme and this is how I resolved it.
Here is the issue that I have found. When IMCE is loaded it is loaded into an iFrame. This iFrame includes all of the CSS and JS that was on the original page in the head. This can cause a problem if the JS that you have on your site makes any assumptions about the content that is on the page.
For example. I had this line of code on my site: map_obj.map = new GMap2(document.getElementById("map-canvas"));
The 'map-canvas' WAS on the PAGE, but it was NOT in the IMCE iFrame. Because all the CSS and JS is loaded into the head of the iFrame, this line of code was attempting to run in the context of the iFrame. This was giving an error of "Uncaught TypeError: Cannot read property 'firstChild' of null" which was causing the options in IMCE not to load.
I was able to solve this by simply doing a test to make sure the element was on the page with something like: if ($("#map-canvas").length > 0) { addGMapToPage(); }
Basically, this problem is due to some JS file making an assumption that something is on the page (which it may be), but it is not on the page in the context of the IMCE iFrame.
I hope this helps someone...
Comment #22
fuzzyjared commentedMy issue was datepicker() jquery library.
I was calling the function on a couple of custom module form fields
$("#edit-date-from").datepicker();
$("#edit-date-to").datepicker();
removing the datepicker calls allowed imce to work as advertised. It took me forever to find it now I just have to resolve it....
Comment #23
Cyberflyer commentedGeneral issue and resolution
Turns out there is a potential for conflict between IMCE and a lot of themes, among them Clean, Energetic, Acrylic, Zen, Artisteer, Jaded and RootCandy which results in IMCE feature failure, typically--but not limited to--the buttons not appearing at the top of the file browser page.
This is because the file browser inherits the theme's javascript and various issues result, such as name-space collision, missing regions and the like. The hard solution is to go in and deduce the specifics and change your page.tpl files to weed out the conflicts or hack at IMCE.
The easy and generally useful solution is to install ThemeKey and create one rule that forces all pages where drupal:path = imce to use the Garland theme. That simply solves everything, since IMCE works in Garland but has no real theme to it. This post hopes to tie several related threads together to save the next guy time.
http://drupal.org/node/584952#comment-2149802
Comment #24
cardentey commentedMy solution:
Comment #25
nathan573 commented#24 worked for me. I use the stock Drupal 7 "Administration theme" setting at "admin/appearance" (set to "Shiny") and all the file management buttons on the IMCE popup were not displaying whilst editing nodes and using CKEditor and IMCE. When clicking the IMCE button on the CKEditor toolbar a JS error in a custom JS include in the site's main, front-end theme (Zen-based sub-theme) was being thrown, preventing the IMCE popup from working properly. I added the code from #24, customizing the module name and theme to my environment and the IMCE popup now works properly, displaying the buttons that were missing and allowing the preview function to operate. Thanks cardentey!