[ENHANCEMENT]: Add Javascript & CSS tab from site views to modules #1247

Open
opened 2025-08-28 14:17:48 +00:00 by SimonvanDoorne · 2 comments
Member

Enhancement Details

Currently i don't see an option to add custom css and javascript to a module as dedicated files. It is of course possible to add <script> and <style> tags to the module, but it would be nice to have them as seperate files. This is probably a very low priority so completely understand if this won't be implemented for a while :).

Which part of the extension will be affected by this enhancement?

Compilation of component, Joomla Modules(admin_views)

Additional Context

No response

### Enhancement Details Currently i don't see an option to add custom css and javascript to a module as dedicated files. It is of course possible to add <script> and <style> tags to the module, but it would be nice to have them as seperate files. This is probably a very low priority so completely understand if this won't be implemented for a while :). ### Which part of the extension will be affected by this enhancement? Compilation of component, Joomla Modules(admin_views) ### Additional Context _No response_
SimonvanDoorne added the enhancement label 2025-08-28 14:17:48 +00:00
Owner

Seems like a valid request, give me a basic module, where this is implemented, and I will see what I can do. We are currently working on the new native Joomla 5+ module implementation and its nearly finished. We might be able to still add it... lets see.

Seems like a valid request, give me a basic module, where this is implemented, and I will see what I can do. We are currently working on the new native Joomla 5+ module implementation and its nearly finished. We might be able to still add it... lets see.
Owner

Just a quick side note that might be helpful: if you link a field that has JavaScript or CSS attached to it, and that field is linked to a module, then that JavaScript and CSS will load in the module area of the admin view as well. In other words, JCB is already set up so that field-level assets become available wherever the field is used — not just in components.

To recap, there are four key places where field-attached JS/CSS can load:

  • Views – When the field is used in the list view, its JS and CSS will load on that page.
  • View – When the field is used in the edit view, its JS and CSS will load there (this is the usual admin-edit case).
  • Modules – If you link the field to a module, its JS and CSS will load in the module's single view.
  • Front-end – If the field is used in front-end views, its JS/CSS will load there too.

I haven't tested this recently, but this is how it was originally intended to work and should still be stable. It might be worth doing a quick test to confirm everything is still behaving as expected.

The idea of adding a separate "field" specifically for the module area, as you suggested, is still on the table — we just haven't implemented it yet. But this existing behavior might already cover some of what you need.

Just a quick side note that might be helpful: if you link a field that has JavaScript or CSS attached to it, and that field is linked to a **module**, then that JavaScript and CSS will load in the module area of the admin view as well. In other words, JCB is already set up so that field-level assets become available wherever the field is used — not just in components. To recap, there are four key places where field-attached JS/CSS can load: * **Views** – When the field is used in the list view, its JS and CSS will load on that page. * **View** – When the field is used in the edit view, its JS and CSS will load there (this is the usual admin-edit case). * **Modules** – If you link the field to a module, its JS and CSS will load in the module's single view. * **Front-end** – If the field is used in front-end views, its JS/CSS will load there too. I haven't tested this recently, but this is how it was originally intended to work and should still be stable. It might be worth doing a quick test to confirm everything is still behaving as expected. The idea of adding a separate "field" specifically for the module area, as you suggested, is still on the table — we just haven't implemented it yet. But this existing behavior might already cover some of what you need.
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: joomla/Component-Builder#1247