(Joomla 4) Disable unwanted scripts in Frontend #32533
-
I think it should be possible to disable fontawesome and whatever in the frontend. How can this be changed in core to have a more performant initial setup? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 11 replies
-
It's all down to your template and the components etc being displayed. You can see an example at HTTPS://learnjoomla4.com of what can be done. |
Beta Was this translation helpful? Give feedback.
-
All assets loaded via Joomla AssetManager, can be disabled via AssetManager https://docs.joomla.org/J4.x:Web_Assets Example for fontawesome style: |
Beta Was this translation helpful? Give feedback.
-
The fontawesome in Lightning is being loaded by the template itself, the css comes from "Joomla" (media/vendor/.../fontawesome.css), because it is in core and the template doesn't need to deliver an own css for fontawesome. |
Beta Was this translation helpful? Give feedback.
All assets loaded via Joomla AssetManager, can be disabled via AssetManager https://docs.joomla.org/J4.x:Web_Assets
Example for fontawesome style:
$wa->disableStyle('fontawesome')
For core script :
$wa->disableScript('core')
, however there a high chance that it will be re-enabled by one of core feature, example if the document have a script options, translations, etc.