Skip to main content

Templates = Page-Level Views Linked to Custom Admin & Site Views

structure the entire output area and serve as containers for layouts, snippets, injected data, and libraries

๐Ÿ” What Are Templates?

Templates are the top-level render files used to build complete pages โ€” either in the Joomla administrator backend (Custom Admin Views) or on the site frontend (Site Views). They control the overall visual and structural output, like wrappers, sections, grids, headers, footers, etc.

Templates use PHP and JCB placeholders to dynamically inject content, often wrapping one or more Layouts and Snippets.

They live in:

  • /tmpl/templates/ (in the compiled component)
  • Defined and selected via the GUI
  • Automatically linked during view compilation

๐Ÿ“ฆ Core Features

  • โœ… Wrap layouts, snippets, and other output logic
  • โœ… Full PHP support with dynamic variable injection
  • โœ… GUI-assigned and version-controlled
  • โœ… Round-trip friendly (Insert/Replace tags supported)
  • โœ… Supports JS/CSS libraries and Snippet calls
  • โœ… ACL, menu, and route awareness
  • โœ… Separate templates for list or item views if needed

๐Ÿงฑ How Templates Are Used

  • Assigned per Custom Admin View or Site View
  • Provide a structural wrapper (e.g., card groups, flexbox containers)
  • Define view-wide logic and markup beyond repeated elements
  • Can include logic like conditional sections, dynamic buttons, or toggles
  • Perfect for dashboards, single-page apps, and complex form flows

๐Ÿ’ก Example Use Cases

  • A full dashboard template with stats and filters
  • A frontend gallery wrapper using UIkit or Bootstrap
  • An import interface with multi-step logic
  • A backend listing view with collapsible widgets

๐Ÿ› ๏ธ Maintenance & Version Control

Templates can be:

  • Initialized from base blueprint repositories
  • Reset to master versions (for syncing updates)
  • Exported or imported via JSON
  • Forked for project-specific needs
  • Injected with field references, custom code, and language strings

๐Ÿ”— Related Concepts

  • Layouts = reusable inner renderers
  • Snippets = modular blocks of logic/markup
  • Libraries = external JS/CSS (linked per Template)
  • Custom Admin Views & Site Views = assign Templates
  • Dynamic GETs = supply the data used within Templates

๐Ÿ“˜ Conclusion

Templates give you complete control over how each view in your component is rendered from top to bottom. Whether youโ€™re building complex admin dashboards or elegant frontend pages, templates provide the structural foundation needed to present data and interface elements with full design freedom โ€” all while remaining maintainable and reusable.