Pages: 1
Hi,
trying to find proper way to load JS script when in admin area
* Admin sets active site theme (not admin theme and not a plugin)
* add event handler which would be triggered when anywhere in Admin area
* load/add JS link to footer's get_combined js link section
Advise or better yet live example if implemented anywhere
PS: I know AdminTools plugin adds top menu but my attempt to add greydragon_add_admin_controller seems to fail as I do not think it is registered in context of admin section.
I am sure it is simple question and just a matter of using proper code from proper place :)
Offline
Use {combine_script ..} from within the respective admin/template/*.tpl file?
Last edited by teekay (2017-01-11 23:26:37)
Offline
teekay wrote:
Use {combine_script ..} from within the respective admin/template/*.tpl file?
I know about how to add js reference from tpl, issue is that theme's admin templates would be loaded for theme's admin area and not entire sites admin area
Offline
I'm afraid that's impossible: non-admin themes are not read while being on admin section, unlike plugins which are executed everywhere
Your theme could add a companion plugin on activation, then delete files on uninstall
Offline
flop25 wrote:
I'm afraid that's impossible: non-admin themes are not read while being on admin section, unlike plugins which are executed everywhere
Your theme could add a companion plugin on activation, then delete files on uninstall
companion plugin would have to be activated
can it be done automatically?
Offline
apriori yes [Github] Piwigo file admin/include/plugins.class.php
and yous till can manually update the conf to enable it then do a load_conf_from_db(); . Dirty but it should works since you handle the installation for the theme already
Offline
thank you
will try
Offline
Pages: 1