joomla_extensions_development icon indicating copy to clipboard operation
joomla_extensions_development copied to clipboard

In joomla.asset.json the URI requires the prefix of the extension.

Open Irata opened this issue 2 years ago • 1 comments

In the section on Web Assets, https://www.dionysopoulos.me/book/concepts-webassetmanager.html, the examples provided show a uri of the file name only, e.g.

"uri": "backend.min.css",

however I was not able to get my implementation to work using just the file name, I had to add the extension or directory name as such

"uri": "com_emporium/trolleyFunctions.js",

I found that solution in the joomla.asset.json for Akeeba Backup;

			"name": "com_akeebabackup.akeebaui",
			"description": "Common user interface CSS, light mode",
			"type": "style",
			"uri": "com_akeebabackup/akeebaui.css"

I couldn't see anything in the documentation explaining Web Assets that mentioned the prefix is required therefore I am not sure if it is an instance of the examples need updating or an explanation is required in the text body.

Irata avatar Nov 07 '22 21:11 Irata

Yes, the URI is wrong. It should be something like com_foobar/backend.min.css. Joomla expands it to media/com_foobar/css/backend.min.css, the same it's been doing with HTMLHelper::('style', …) since Joomla 1.5.

nikosdion avatar Nov 08 '22 11:11 nikosdion

Resolved in commit caa00b2a

HermanPeeren avatar Dec 17 '22 08:12 HermanPeeren