In /media/templates/administrator/atum/js/ create user.js
js loading in browser
js not loading
Joomla 5.1 8.2.10-2ubuntu1
template.min.js does show; the user.js added to cassopia in front end works fine.
user.css is loading properly so no double gzip compression issue
Labels |
Removed:
?
|
Labels |
Added:
No Code Attached Yet
|
@brianteeman it's a pity,For now I will add the js to the php view of the pages/modules I need it on.
Could this be a feature request?
Can you epxlain more the use case for adding js to every page of the admin
I would use it for Custom CSS display and communication :
-Custom pages : I want to hide certain content/options to site managers for a page or a module if there is a specific value in its DOM(the element can just be the value of the custom field from the page/module).
Then JS would get this value and add a class to the page to hide items.
-Custom communication : I want to communicate specific information to a site manager through a module using the before/after pseudoclass which would be added if JS spot the value of a custom field
I am sure that there are other cases where this would be useful as as you know you get the benefit of not having to update the extension/module files on each update.
I saw a few requests on forum and here also for this feature :
https://joomla.stackexchange.com/questions/33016/adding-javascript-to-the-administrator-template
No worries if it does not get implemented though but to see if its worth it, maybe we need the opinion of more developers with their own case?
And maybe also the security aspect could be evaluated because it is also an easy way to add JS everywhere in the admin section
From the sound of it you should be adding the js with the module and then it is only loaded on the pages that uses the module. Adding it to the template itself as you request would add the script everywhere.
Well, it is for a few different modules an 1 extension but I will create templates overrides.
I made this suggestion mostly because I thought that it would benefit other developers wanting to customize the admin interface easily.
My point is that this is not the correct way to do it. You should not be loading javascript everywhere if it is not needed. That is what the web asset manager is for.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2024-05-05 19:32:52 |
Closed_By | ⇒ | joomlafun |
@brianteeman I was not aware of the web asset manager. I will check it out, thank you.
https://docs.joomla.org/J4.x:Web_Assets
unlike in cassiopeia there is no code in
atum/joomla.asset.json
to load any user.js