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.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.
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".
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", ] }
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", ] }
Statistics: Posted by mastalnise — Wed Jun 26, 2024 7:35 pm