Forums / Customization from the Admin / How to auto load jacascript for all pages in the backend?

How to auto load jacascript for all pages in the backend?

Views: 1,435

Results 1 to 6 of 6
4 Aug 2016, 8:28 PM
#1
su35 avatar

su35

Zen Follower

Join Date:
Oct 2011
Posts:
168
Plugin Contributions:
0

How to auto load jacascript for all pages in the backend?

In the frontend, the javascript with jscript_ will auto-load. How to do that in the backend?

5 Aug 2016, 2:07 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: How to auto load jacascript for all pages in the backend?

Do you really need it on EVERY admin page?

In v1.5.5:

  • To make it available on EVERY admin page (not recommended), I suppose you could stick a call for it into /admin/includes/general.js or /admin/includes/menu.js
  • Or to put it on the SPECIFIC PAGE where you need it, simply edit the admin/whatever_page_name.php file and put the necessary <script> tag in the section that outputs the <head> html.

There will be improvements in v1.6.0 for making js easier to implement on the backend. But for v1.5.5 the above is probably the best approach.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

7 Aug 2016, 2:57 PM
#3
su35 avatar

su35

Zen Follower

Join Date:
Oct 2011
Posts:
168
Plugin Contributions:
0

Re: How to auto load jacascript for all pages in the backend?

Thanks. I will try it. I want to load a table sort js to make it easy to find the configuration item.

7 Aug 2016, 10:06 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: How to auto load jacascript for all pages in the backend?

su35:

I want to load a table sort js to make it easy to find the configuration item.
Maybe you should just use the Configuration Search/Lookup inside the Admin->Tools->Developer Toolkit screen.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

7 Aug 2016, 10:58 PM
#5
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,733
Plugin Contributions:
56

Re: How to auto load jacascript for all pages in the backend?

Also, there is this plugin: https://www.zen-cart.com/downloads.php?do=file&id=1107 (Search Configuration Keys)

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

8 Aug 2016, 5:10 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: How to auto load jacascript for all pages in the backend?

swguy:

Also, there is this plugin: https://www.zen-cart.com/downloads.php?do=file&id=1107 (Search Configuration Keys)
... which is already built-in to v1.5.5

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.