Quantcast
Channel: Joomla! Forum - community, help and support
Viewing all articles
Browse latest Browse all 1010

Templates for Joomla! 5.x • The curious case of Joomla web assets

$
0
0
I use the preset to use Joomla web assets. This method, in addition to being simple, requires less coding.

According to what we know about Joomla web assets, to use an asset in the medi>vendor folder, it is enough to add the asset name (which is in the media>vendor>joomla.asset.json file) in the preset list of the Joomla.asset.json template file. For example, to use Bootstrap, it is enough to copy it to the Jason file preset like this.

Code:

{            "name": "all-asset",            "type": "preset",            "description": "style and script",            "dependencies": [                "bootstrap.css#style",                "bootstrap.es5#script",            ]        }
But this method doesn't work fontawesome and we have to register it in the joomla.asset.json file and write the path of the media>system folder and then write the asset name in preset list.

Code:

{            "name": "anotherfontawesom",            "type": "style",            "uri": "system/joomla-fontawesome.min.css"        },        {            "name": "all-asset",            "type": "preset",            "description": "style and script",            "dependencies": [                "bootstrap.css#style",                "anotherfontawesom#style",                "bootstrap.es5#script",            ]        }
Also, we must use a different name from the name of the media>vendor>joomla.asset.json to load fontawesome in template. We cannot use the term "fontawesome" and must use another name, for example "anotherfontawesom".

Statistics: Posted by mastalnise — Wed Jun 26, 2024 7:35 pm



Viewing all articles
Browse latest Browse all 1010

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>