We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Need extension to add something to admin page <head>s

Development and Programming

LynneL's avatar
LynneL
239 posts
17 years ago
LynneL's avatar LynneL

OK so I have this issue with TinyMCE/ibrowser/imagemanager, which the TinyMCE developer says is the result of cross domain calls, which imagemanger (and presumably other plugins for TinyMCE) does not deal with yet (he says that might happen in a future version if Imagemanager at least). He says that the script path (in EE’s case, in the settings for the Tiny extension) needs to be the same URL as where you are viewing the page from (in the browser address bar), or else some browser’s security causes the imagemanager (and possibly ibrowser, haven’t tested it yet).

He said to solve the problem of not being able to dictate whether the client use the www. version of the URL to view their admin pages, you can write a JS script in the page you’re using Tiny, with the following code:

document.document = 'www.domain.org';

I would love to, in my admin pages, just stick that script in there, solve my problem completely. However, I don’t want to hack it into the core files to do so. Is there an existing way to do this, or an existing extension?

(Edit: genericized the sample domain!)

       
LynneL's avatar
LynneL
239 posts
17 years ago
LynneL's avatar LynneL

To be honest, I have no idea how to go about doing that. I mean, I’m guessing I could find the file that the EE admin index.php was pulling from to create the pages and stick in a little script tag with the line of js, but I have never dived into how EE really works under the hood with regards to plugins/extensions and the like.

I suppose it’s inevitable I’ll end up doing it at some point…if only because my needs are getting weirder and more complex. 😛

Hmm, maybe this is a good place to start…except I need to get this project done and the client is waiting. Sigh…

       
LynneL's avatar
LynneL
239 posts
17 years ago
LynneL's avatar LynneL

As always, spoke too soon. I found the function in the plugin which puts js in the header for Tiny.

function add_header()

Now look what you made me do. Experiment. Trouble ensues…I really stink at coding but here goes.

       
LynneL's avatar
LynneL
239 posts
17 years ago
LynneL's avatar LynneL

Blegh, no go. Moxie’s developer had actually said to add that script to the imagemanager template’s index.html:

In other words change the src=”” to be the same as the domain and it should work or hard code a document.domain into the imagemanager/page/im/index.html. Like this, add this to the top of index.html file: [script type=”text/javascript”] document.document = ‘www.domain.org’; [/script]

In other words, hard code the domain into the plugin template. Which didn’t work (either with document.document or document.domain which is what I suspected he meant to type in his example).

For now, I will just mention to clients that they must use www.domain.org/pathtoadmin in their browser in order for image uploading via TinyMCE to work right. Most people, even techies, always type in the www. part anyway. I’m an exception. (Even my techie husband does it, it drives me nuts…”just skip the www part already! you could already be done typing the URL in the browser by now if you’d just skip the www!” LOL)

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.