JSON Joomla! 6 Joomla! 5 Joomla! 4 Template Basic

Register Modular CSS and JavaScript in joomla.asset.json

Declarative WebAssetManager manifest defining styles, deferred scripts, dependencies and a single reusable preset.

Updated on 24 November 2026 62 copies 210 views
media/templates/site/meu_tema/joomla.asset.json
{
  "$schema": "https://developer.joomla.org/schemas/json-schema/web_assets.json",
  "name": "meu_tema",
  "version": "1.0.0",
  "license": "GPL-2.0-or-later",
  "assets": [
    {
      "name": "template.meu_tema.css",
      "type": "style",
      "uri": "custom.css",
      "version": "1.0.0"
    },
    {
      "name": "template.meu_tema.js",
      "type": "script",
      "uri": "app.js",
      "version": "1.0.0",
      "dependencies": ["core"],
      "attributes": { "defer": true }
    },
    {
      "name": "template.meu_tema",
      "type": "preset",
      "dependencies": [
        "template.meu_tema.css#style",
        "template.meu_tema.js#script"
      ]
    }
  ]
}
Place inside media/templates/site/<template>/ or media/com_example/.

Technical explanation and best practices

joomla.asset.json registers styles, scripts and presets cleanly with automatic dependency ordering. Activate the entire bundle in PHP with a single $wa->usePreset('template.my_theme') call.

Direct Engineering

Have a Joomla project or technical challenge in mind?

From architectural diagnosis to production deployment, directly with the engineer.