Override the layout of Smile Pack modules
Customize any Smile Pack module with a Joomla template override: which layout to copy, where to put it, and what each override changes.
You can change the HTML or the data of any Smile Pack module with a Joomla template override. Your changes live in your template, so a Smile Pack update won't overwrite them.
Which layout should you override?
Every Smile Pack module renders in 2 steps. First, the module layout reads the module settings and prepares the data (the map markers, the gallery images, the accordion panels). Then it hands that data to a widget layout, which prints the final HTML.
You can override either one:
- Module layout: change the data before it's displayed, or wrap the module in your own HTML. It only affects Smile Pack modules of that type.
- Widget layout: change the HTML itself. Widgets are shared with other Tassos extensions, so the override also changes fields that use the same widget, like the ACF - Map and ACF - Gallery fields.
| Module | Module layout folder | Widget layout folder |
|---|---|---|
| Accordion | mod_spaccordion |
accordion |
| Gallery | mod_spgallery |
gallery (Grid, Masonry and Justified styles)slideshow (Slideshow style) |
| Map | mod_spmap |
openstreetmap, googlemap or bingmap, depending on the Provider |
| Video | mod_spvideo |
video (YouTube, Vimeo, Dailymotion, Facebook)selfhostedvideo (Self-hosted) |
| PayPal Button | mod_sppaypal |
Not available |
Override the module layout
A module layout override works like any other Joomla module override. Joomla's Template Manager can create it for you:
- Log into your Joomla backend.
- Go to System → Site Templates.
- Click YOUR_TEMPLATE Details and Files.
- Open the Create Overrides tab.
- Under Modules, click the Smile Pack module you want to override, for example mod_spmap.
Joomla copies the module's layout into your template:
/templates/YOUR_TEMPLATE/html/mod_spmap/default.php
Open that file and make your changes. To create the override by hand instead, copy /modules/mod_spmap/tmpl/default.php to the path above.
The Video module
The Video module's default.php loads a separate file for each provider from a providers folder next to it. Create Overrides copies this folder for you. If you create the override by hand, copy the whole /modules/mod_spvideo/tmpl/ folder, including providers, to:
/templates/YOUR_TEMPLATE/html/mod_spvideo/
To change only the YouTube output, edit providers/youtube.php and leave default.php as it is.
Override the widget layout
Override the widget layout when you need different HTML markup. Smile Pack loads widget overrides from the html/tassos/widgets folder of your template.
- Find the widget folder of your module in the table above, for example
openstreetmap. - Copy the widget layout from:
/plugins/system/nrframework/layouts/widgets/openstreetmap/default.php - Paste it into your template, creating any missing folders:
/templates/YOUR_TEMPLATE/html/tassos/widgets/openstreetmap/default.php - Open the copied file and make your changes.
The override takes effect immediately on every Smile Pack module and every field that uses this widget. If you only want to change the Smile Pack module, override the module layout instead.
Gallery sub-layouts
The Gallery widget splits its HTML into smaller files inside a default folder: item.php (a single image), tags.php (the filtering tags) and glightbox.php (the lightbox). To change one of them, copy it into the same structure in your template:
/plugins/system/nrframework/layouts/widgets/gallery/default/item.php
to
/templates/YOUR_TEMPLATE/html/tassos/widgets/gallery/default/item.php
You only need to copy the files you change. Any file missing from your template loads from the original folder.
Keep your overrides up to date
Your override is a copy of the original layout. When a Smile Pack or Tassos Framework update changes the original file, your copy keeps the old code. After an update, compare your override with the new original and copy over any changes you need.