Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

atum user.js not loading #43320

Closed
joomlafun opened this issue Apr 20, 2024 · 8 comments
Closed

atum user.js not loading #43320

joomlafun opened this issue Apr 20, 2024 · 8 comments

Comments

@joomlafun
Copy link

Steps to reproduce the issue

In /media/templates/administrator/atum/js/ create user.js

Expected result

js loading in browser

Actual result

js not loading

System information (as much as possible)

Joomla 5.1 8.2.10-2ubuntu1

Additional comments

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

@brianteeman
Copy link
Contributor

unlike in cassiopeia there is no code in atum/joomla.asset.json to load any user.js

@joomlafun
Copy link
Author

@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?

@brianteeman
Copy link
Contributor

Can you epxlain more the use case for adding js to every page of the admin

@joomlafun
Copy link
Author

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

@brianteeman
Copy link
Contributor

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.

@joomlafun
Copy link
Author

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.

@brianteeman
Copy link
Contributor

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.

@joomlafun
Copy link
Author

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants