Hi there
I'm developing my own module, and it already goes very well.
But now i need some javascript on the admin side of the site.
And I can't find how to make a tag in the head of the admin pages without changing the theme.
Is this possible?
If yes, how?
If not, maybe there is another nice way to embed javascript on the admin side?
Thanks!
[Solved] add a javascript file to the admin section
[Solved] add a javascript file to the admin section
Last edited by hostep on Tue May 20, 2008 10:56 pm, edited 1 time in total.
-
rayman22201
Re: add a javascript file to the admin section
I also needed to add some javascript to an admin module and had the same trouble, and couldn't find an easy solution directly.
I ended up kind of cheating by embedding the script into an Iframe, passing any variables I needed from the module as GET variables in the SRC tag of the iframe... It is a really patchwork solution, but it worked in a hurry.

I ended up kind of cheating by embedding the script into an Iframe, passing any variables I needed from the module as GET variables in the SRC tag of the iframe... It is a really patchwork solution, but it worked in a hurry.
Re: add a javascript file to the admin section
Thanks for the reply, but in the mean while I already found the correct solution.
You just have to put the extra javascript tags in the GetHeaderHTML() function in the module.
That's much cleaner than your patchwork
You just have to put the extra javascript tags in the GetHeaderHTML() function in the module.
That's much cleaner than your patchwork
-
calguy1000
- Support Guru

- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: [Solved] add a javascript file to the admin section
I usually just embed the javascript into whichever templates I need, then there's no issue.
if I need the javascript in more than one template, I can use smarty's {include} tag.
if I need the javascript in more than one template, I can use smarty's {include} tag.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
-
rayman22201
Re: add a javascript file to the admin section
You know....I really need to read the api more closely....Then again I was in a really big hurry when I came up with the iframe solution, but either way, thanks, now I know how to do it the right wayhostep wrote: Thanks for the reply, but in the mean while I already found the correct solution.
You just have to put the extra javascript tags in the GetHeaderHTML() function in the module.
That's much cleaner than your patchwork![]()

