5116 Posts in 1525 Topics by 1118 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1343 Views |
-
Add JavaScript to Administrative Area

12 July 2010 at 10:54pm
This code adds my custom JavaScript to BOTH the administrative area AND the public website:
// from mysite/code/page.php
function getCMSFields() {
Requirements::javascript( 'mysite/javascript/custumL.js ' );
}I only want to add the JavaScript to the administrative area. It should NOT be loaded on the public website.
-
Re: Add JavaScript to Administrative Area

13 July 2010 at 4:36pm
Use this in your _config file
LeftAndMain::require_javascript('mysite/javascript/custumL.js');
LeftAndMain is the class which handles the CMS. Though unless you call getCMSFields() on the front end of the site it shouldn't include any JS from that function.
-
Re: Add JavaScript to Administrative Area

28 February 2012 at 3:26am
Is this still working in 2.46?
I tried it without success....
| 1343 Views | ||
|
Page:
1
|
Go to Top |


