Template Overrides
Every public page of Next Self-Catering is built from Joomla layouts. You can change any of them in your template without touching the extension, and you can add layouts of your own. Updates never overwrite your files.
This page lists every layout, the data each one receives, the data-nsc-* hook attributes the
page script relies on, and the site events your own scripts can listen to.
How overrides work
There are two kinds of files.
Component layouts live in components/com_nextselfcatering/layouts/<kind>/<name>.php. To
override one, copy it to:
templates/<your template>/html/layouts/com_nextselfcatering/<kind>/<name>.php
Module templates live in modules/mod_nextselfcatering_<name>/tmpl/<file>.php. To override
one, copy it to:
templates/<your template>/html/mod_nextselfcatering_<name>/<file>.php
Joomla's own System > Site Templates > (your template) > Create Overrides tab does the copy for modules. For component layouts, copy the file by hand or with the template editor.
Each layout file starts with a comment that names its data and the hooks to keep. That comment is the reference for the version you have installed.
Add a layout of your own
Five kinds can take extra layouts: card, list, filter, property and pagination. Drop a new file next to the overrides, for example:
templates/<your template>/html/layouts/com_nextselfcatering/card/compact-price.php
It then shows in every layout picker: Configure > Settings > Site layouts, the menu item
forms, the module forms and the property's Page tab. It gets a generic thumbnail. Add
compact-price.svg next to the PHP file to give it its own.
A new layout receives the same data as the built-in layouts of its kind. If a page asks for a layout that no longer exists, the kind's default layout is used.
Files directly in filter/ count as filter layouts. The filter's parts live in filter/part/ so
they never show up as a choice.
Which layout a page uses
- Property page: the property's own choice, then the menu item's, then Settings > Site layouts.
- Properties list: the menu item's choice, then Settings > Site layouts.
- Modules: their own settings.
Rules that keep a page working
- Keep every
data-nsc-*attribute a layout's comment names. The scripts find elements by them. - Keep form field
names. They are the filter keys in the address (see Filter keys). - Keep the island elements (
data-nsc-island="..."with theirdata-props). - Prices are wrapped in a
data-nsc-pricespan so the currency picker can convert them. Keep it. - Classes use the
nsc:prefix (Tailwind 4). New classes you add in an override are not in the built stylesheet. Style your own markup in your template's CSS, or use the theme variables. - Escape what you print with
htmlspecialchars()or$this->escape(), as the originals do.
Property cards: card/
Used by the Properties list, the properties module, similar properties and the wishlist.
| File | Layout |
|---|---|
card/classic.php |
Photo slider on top with the price, badge and heart, then title, place, facts and rating (default) |
card/horizontal.php |
Photo on the left, details and a View details button on the right |
card/overlay.php |
Photo fills the card, text on a dark gradient |
card/minimal.php |
Square photo and three short lines; the whole card is the link |
Data (every card gets the same):
| Key | Type | What it is |
|---|---|---|
card |
array | id, title, url, cover {url, alt, path, width, height} or null, photos (list of {url, alt, path, width, height}, optional; the photos are printed by image/picture.php), city, region, sleeps, bedrooms, bathrooms, max_pets, price (minor units) or null, currency, rating or null, review_count, summary, featured (optional), badge (optional), shift (days the stay was moved by flexible dates, optional) |
nights |
int | Nights searched. 0 means no dates: the price is the lowest nightly price |
heading |
string | h2, h3 or h4 for the title (default h2) |
loading |
string | eager for the first cards in view, else lazy |
Hooks: data-nsc-property="<id>" on the root (the map highlights the card's pin from it),
data-nsc-price on the price, button[data-nsc-wishlist="<id>"] for the heart. The heart is
printed hidden; the wishlist script shows it.
List layouts: list/
| File | Layout |
|---|---|
list/grid.php |
Cards in 2, 3 or 4 columns (default) |
list/list.php |
One card per row. The Classic card shows as Horizontal here |
list/table.php |
Compact rows for comparing many properties. No card layout |
list/calendar.php |
One row per property with its free and booked days (uses the calendar/ layouts) |
Data:
| Key | Type | What it is |
|---|---|---|
items |
list | The cards (see card/) |
nights |
int | Nights searched |
card |
string | The card layout name |
columns |
int | 2, 3 or 4 |
offset |
int | Position of the first card in the whole list (0 on page 1) |
heading |
string | Heading tag of the card titles |
from, link, days |
string, string, int | Calendar only: first day shown, the page address for paging without script, days shown (7 to 35) |
Hooks: data-nsc-list-items on the element whose children are the cards. Load more and
Load on scroll append the next page's children to it. In the table and calendar this is the
tbody. Each table row keeps data-nsc-property and data-nsc-price.
Pagination: pagination/
| File | Layout |
|---|---|
pagination/ajax.php |
Page numbers, no reload (default) |
pagination/loadmore.php |
A Load more button |
pagination/infinite.php |
Loads on scroll for a few pages, then a Load more button |
pagination/classic.php |
Joomla's own page links, each a full page load |
Data: mode, page, pages, total, per_page, shown, window (list of
{page, url, current}; page null means "..."), first, prev, next (URLs, empty for none),
auto_pages (pages loaded on scroll), label (accessible name) and pagination (Joomla's
Pagination object).
Hooks: a[data-nsc-page] on page links, a[data-nsc-load-more] on the Load more link,
data-nsc-shown on the "n of m" counter, data-nsc-infinite on the load-on-scroll wrapper,
data-nsc-first-page on the "back to the first page" link (shown after a reload on a later page).
Every link is a real link, so pages work without script and search engines can follow them.
Filter: filter/
| File | Layout |
|---|---|
filter/topbar.php |
Stay bar above the results, quick chips, other groups behind More filters (a window over the page, a sheet from the bottom on phones; the <details> opens it without script) (default) |
filter/sidebar.php |
Every group in a column beside the results, behind a Filter button on phones |
filter/part/core.php |
Group "Your stay": where, dates with flexible days, guests, pets |
filter/part/facts.php |
Group "The property": price, bedrooms, bathrooms, type, rating |
filter/part/location.php |
The "Where" field: a select, a type-ahead with script. Also used by the search and map modules |
filter/part/party.php |
Guests and pets: two number boxes, the guests popover with script. Also used by the search and map modules |
filter/part/bedrooms.php |
Bedrooms as chips: Any, 1+ to 5+. Also used by the search module |
filter/part/types.php |
Property types as icon chips (several can be chosen). Also used by the search module |
filter/part/amenities.php |
Group "Amenities": one box per feature, with counts |
filter/part/rules.php |
Group "Booking": short breaks, changeover day, instant or on request, offers, featured |
filter/part/quick.php |
Quick amenity chips |
filter/part/chips.php |
The active filters as removable chips above the results, plus Clear all |
Data of the two filter layouts and the groups:
| Key | What it is |
|---|---|
criteria |
The current search (SearchCriteria) |
errors |
Field name to language key |
locations |
List of {id, title, level, count} (count: published homes there, sub-locations included) |
features |
List of {id, title, icon, group} |
action |
The form's action |
hidden |
Hidden routing fields (sites without SEF URLs) |
today |
The earliest arrival (Y-m-d) |
groups |
Which of core, facts, amenities, rules show |
facets |
The counts beside each choice |
types |
List of {value, label, count} |
quick |
Feature ids of the quick chips |
price |
{steps, currency, unit} |
carry |
Hidden fields for filters that have no field in this layout |
party |
{guests, pets}: the most guests and pets any published home takes (the guests popover's limits; 0 pets hides the pets counter) |
reviews |
Whether the rating filter shows |
active |
Filters set inside More filters |
id |
Element id prefix |
The groups also get layout (topbar or sidebar). The amenities group gets quick_inline.
Chips data: chips (list of {key, label, url}), clear (the list without filters) and
label.
Hooks: form[data-nsc-properties-filter] on the form. data-nsc-filter-group,
data-nsc-filter-panel, data-nsc-filter-toggle, data-nsc-filter-more,
data-nsc-filter-close, data-nsc-filter-reset, data-nsc-filter-backdrop, data-nsc-filter-fold,
data-nsc-filter-active, data-nsc-filter-submit, data-nsc-filter-arrival and
data-nsc-filter-departure for the panel, drawer and date fields. data-nsc-price-range (with
data-min, data-max and data-histogram, a JSON list of how many results fall in each equal
slice of the range) on the price box and data-nsc-price-selects on its two selects: the script
turns them into one two-handle slider with Lowest / Highest boxes over a small bar chart of the
prices ([data-nsc-price-slider], [data-nsc-price-handle="min|max"],
[data-nsc-price-input="min|max"], [data-nsc-price-bars]; plain CSS in priceSlider.css). data-nsc-facet="<facet>:<key>" on every count, and
data-nsc-label on options that show one. data-nsc-default on the radio that means "any"
(the script counts and clears filters from it). a[data-nsc-chip] on each chip.
The dates in filter/part/core.php follow the date field hooks (see
Date fields and form checks): one [data-nsc-date-range] block with
data-flex="1", so the flexible days become chips in the date picker. The form carries
data-nsc-validate-form, so a half-chosen stay is stopped with a message before it is searched.
Where, guests, bedrooms and types are their own parts, shared with the modules (see Search fields).
The filter is a plain GET form. It works without script. With script, each change applies at once. A stay applies once both dates are chosen, or both are cleared. The guests popover applies when it closes.
Search fields: where, guests, bedrooms, types
These four parts render the same field in the filter, the search module and the map module. Override a part once and every form follows. Each works without script; script enhances it.
filter/part/location.php (data: id, locations, selected, label, anywhere, field,
caption, class). A <select name="location"> of the locations. Script hides it (it stays the
form field) and puts a type-ahead box in front of it: typing filters the places (accents and case
ignored, so "fussen" finds Füssen), each with the place above it and how many homes it holds. It
follows the ARIA combobox pattern: arrow keys move, Enter chooses, Escape closes. Keep
[data-nsc-location] (with data-placeholder), the label's for, select[data-nsc-location-select]
and on each option data-title, data-level and data-count (value 0 = anywhere). The box's
parts: [data-nsc-location-combobox], [data-nsc-location-input], [data-nsc-location-list],
[data-nsc-location-option="<id>"], [data-nsc-location-clear].
filter/part/party.php (data: id, criteria, limits {guests, pets}, pets, label,
pets_label, placeholder, field, caption, class). Two number boxes, guests and pets.
Script turns them into one field ("2 adults · 1 child · 1 pet") that opens counters for adults,
children (2 to 17), infants (under 2) and pets, with Done; a bottom sheet on phones. Adults and
children count as guests, infants never do (as in the booking box). The counters stop at the
largest home and the pets counter only shows when some home takes pets. It sends guests and
pets, plus adults, children and infants when the party has children or infants. Keep
[data-nsc-party] with data-max-guests, data-max-pets, data-adults, data-children,
data-infants, data-label and data-placeholder; [data-nsc-party-native] around the boxes;
data-nsc-party-guests and data-nsc-party-pets on the inputs. The field's parts:
[data-nsc-party-field], [data-nsc-guests-trigger], [data-nsc-party-counter="adults|children|infants|pets"],
[data-nsc-guests-done], [data-nsc-party-clear]. The block gets data-nsc-party-enhanced="1".
The party chosen is remembered for the browser tab, so a property page opened later starts from it.
filter/part/bedrooms.php (data: id, value, label, any, top, counts, caption).
Chips Any, 1+ to 5+. Each chip is a real bedrooms radio button (hidden, its label is the chip), so
the arrow keys move between them and it works without script. Keep data-nsc-default on Any and,
with counts, data-nsc-facet="bedrooms:<n>".
filter/part/types.php (data: id, types, selected, label, counts, caption). Icon
chips, each a real type[] tick box, so several can be chosen. The icons come from
property/part/icon.php; the type-to-icon map is Domain\Property\PropertyTypeIcons. Keep
name="type[]" and, with counts, data-nsc-facet="types:<type>".
Property page: property/
Page layouts (each places the sections):
| File | Layout |
|---|---|
property/mosaic.php |
Title, photo mosaic, sections in one column, booking box sticky on the right (default) |
property/hero.php |
Wide photo slider with the title over it, a bar of anchors, booking box on the right |
property/split.php |
Photos one under the other on the left with the sections below them; title and highlights on the right, then the booking box, sticky |
property/compact.php |
One column; every section after the booking box is an accordion (whatever Block style and Fold blocks on phones say; the section nav shows when it is on) |
property/showcase.php |
Full-width photo carousel, title over it, booking card overlapping its lower edge |
property/magazine.php |
Large lead photo, a wide reading column with photos between the sections, a slim booking bar |
property/gallery.php |
A grid of the photos above the title, then the sections and the booking box |
property/sidebar.php |
A left column (highlights, then the booking box, sticky), the sections on the right |
Data (every page layout gets the same):
| Key | What it is |
|---|---|
id |
The property id |
item |
The property |
media |
Photos {path, alt, caption}, cover first |
sections |
The sections that show, in order: {key, title, anchor, html, icon} (icon: an icon name for the heading) |
reviews |
{stars, count, ...} or null |
reviewsAnchor |
Whether the reviews section is on the page: the star average links to #reviews only then |
pageHeading |
The menu item's page heading ('' for none) |
rootClass |
Theme scope class and the menu item's page class |
booking |
The booking box markup |
fromPrice |
Lowest nightly price, ready to print ('' for none) |
mobileBar |
Whether the fixed bar shows on phones |
options |
The display options (below). Read them with PropertyPageHtml::options($displayData), which fills in the defaults |
features |
Amenities by group: group to list of {id, title, icon}, the icon already chosen |
PropertyPageHtml::pageParts($displayData, $force, $drop) works out what every built-in page
layout starts from: the options (with $force on top, as the magazine layout forces
bookingPosition "bar"), the gallery and similar sections, the section mode, side (booking
box beside the content), nav, bar, glance (the highlights row, PropertyPageHtml::glance())
and main (the sections for the content column). A layout of your own can start from it too.
Keep the page root's id nsc-property-<id>: the property-page island (dialogs, section nav,
Share and Print, the booking sheet on phones, clamps, accordions, slider counters) is printed once
by the view after the page layout, outside every override, and finds the page by that id. On phones
print the blocks in the order they show (photos, title, highlights, sections, booking box) and
place them with grid columns from the lg breakpoint, so screen readers and the keyboard follow
what is on screen.
Display options (options; Settings > Property page, and per Single Property menu item).
Every section layout gets them too, as $displayData['options']:
| Key | Values | What it does |
|---|---|---|
sectionStyle |
divided, cards, plain |
How the sections are set apart: thin lines, cards or nothing. PropertyPageHtml::sectionMode($displayData) gives the matching part/section.php mode |
sectionNav |
true / false | The sticky bar of section links |
highlights |
true / false | The icon row under the title (sleeps, bedrooms, bathrooms, pets, rating) |
descriptionLines |
0, 3 to 20 | The description is cut to this many lines with "Read more" (0 = never) |
amenitiesPreview |
4 to 30 | Amenities listed before "Show all" |
mapHeight |
200 to 600 | The map's height in pixels |
calendarPrices |
true / false | Nightly prices on the calendar days |
enquiryMode |
modal, tabs, inline |
"Ask a question" from the booking box (a window or a tab) or as a page section. In modal and tabs the enquiry section is not printed |
bookingPosition |
sidebar, bar |
The booking box beside the sections, or a slim bar at the top |
mobileCollapse |
true / false | On phones, the sections after the description fold into accordions (the island turns each heading into a toggle; the compact layout's blocks always fold) |
actions |
list of share, save, print |
The buttons in the title area, in this order |
Icons. PropertyPageHtml::icon($name, $class, $label) prints one icon of the site's set
through property/part/icon.php (override that file to draw your own). The names are listed in
Domain\Property\AmenityIcons::NAMES. An amenity shows the icon picked for it in the admin, else
one matched on words in its title, else a check mark.
Overlays ("Show all", "Read more", "View larger"): print the content with
property/part/overlay.php (id, title, html, size = sm, md, lg or full, back,
source = the id of an element on the page whose content the window shows instead of html, so
text is printed once, as the description's "Read more" does) and
the link with PropertyPageHtml::overlayLink($id, $html, $class); make the id with
PropertyPageHtml::overlayId($name, $propertyId). Without script the overlay opens on #<id> with
CSS only; with script the same link opens a window (a bottom sheet on phones) that the browser's
Back button closes. Keep .nsc-overlay, data-size, the <id>-title heading and
data-nsc-overlay-body.
Parts:
| File | Data |
|---|---|
property/part/header.php |
item, reviews, reviewsAnchor, pageHeading, tone ('' or inverse over a photo), options, showActions (false = the layout places the actions). Keep data-nsc-rating-link |
property/part/highlights.php |
item, reviews (absent = read from the property), reviewsAnchor, tone, class. Keep data-nsc-highlights and data-nsc-rating-link |
property/part/actions.php |
item, options (actions), variant (default text buttons or overlay round buttons over a photo), class. Keep data-nsc-actions, data-nsc-property, data-nsc-share, data-nsc-print, data-nsc-wishlist (+ data-nsc-wishlist-named on a button named by its own text), the hidden attributes and .nsc-card-title |
property/part/nav.php |
The page layout's data plus sections (the content column's). Keep data-nsc-section-nav, data-nsc-nav-link and data-nsc-nav-reserve (with hidden) |
property/part/topbar.php |
id, sections, fromPrice, mobileBar. Keep data-nsc-property-topbar |
property/part/sections.php |
sections, mode, between (markup after the n-th section), open, class |
property/part/end.php |
The page layout's data: prints the all-photos overlay, the booking overlay (top bar) and the mobile bar |
property/part/masonry.php |
id, media, limit (photos shown, default 9) |
property/part/booking.php |
id, booking (the quote-widget island), class. Keep the id and data-nsc-booking-box |
property/part/bar.php |
id, fromPrice, options, reviews (the star average beside the price). Keep data-nsc-price, data-nsc-property-bar and data-nsc-booking-sheet |
property/part/mosaic.php |
id, media |
property/part/photos.php |
id, media |
property/part/lightbox.php |
id, title, media, back. Opens on #nsc-photos-<id> with CSS only; with script the PhotoSwipe lightbox opens instead |
property/part/section.php |
section, mode (divided, card, section or details), open, class. Keep the id and data-nsc-section; in details mode (an accordion) also data-nsc-fold and data-nsc-fold-open |
property/part/icon.php |
name, class, label ('' = decorative) |
property/part/overlay.php |
id, title, html, size, back, source. Keep data-nsc-overlay-panel, data-nsc-overlay-body, data-nsc-overlay-close and data-nsc-overlay-source |
review/compact.php |
review (rating, title, body, display_name, stayed, published, reply): one review card of the reviews section |
Property page hooks (the property-page island and the booking box find these):
| Attribute | On | Meaning |
|---|---|---|
data-nsc-booking-box |
aside#nsc-booking-box-<id> |
The booking box; the nav's Reserve shows while it is out of view |
data-nsc-booking-sheet |
a link to #nsc-booking-box-<id> |
Opens the booking box as a bottom sheet on phones (or where the box is not laid out) |
data-nsc-share, data-nsc-print |
buttons (with hidden) |
Share and Print, shown once the island runs |
data-nsc-section-nav |
the section nav | Fixed at the top once the page scrolls past it; data-nsc-nav-link on each link (aria-current on the one being read), data-nsc-nav-reserve on the price + Reserve |
data-nsc-clamp |
the clamped description (with an id) | Loses its fade when the text fits or keyboard focus enters it; data-nsc-clamp-more on the "Read more" paragraph right after it |
data-nsc-overlay="<id>" |
a link | Opens overlay <id> in a window; data-nsc-overlay-source on an overlay names the element whose content it shows |
data-nsc-map-larger |
a button in the map section | "View larger": the data-nsc-map-frame element moves into a full-screen window |
data-nsc-calendar-section, data-nsc-calendar-heading, data-nsc-calendar-range, data-nsc-calendar-clear |
the calendar section | The heading follows the picked stay; "Clear dates" (with hidden) clears it |
data-nsc-fold, data-nsc-fold-open |
accordion sections | The island turns the heading into a toggle; the one with -open starts open |
data-nsc-captcha-holder="<captcha id>" |
a hidden div after the page |
Holds the captcha of the booking box's "Ask a question" form (modal / tabs) until the form takes it |
data-nsc-rating-link |
the star average link | Goes to #reviews; printed as plain text when the reviews section is off |
The page root carries data-nsc-layout="<name>", and the mobile bar data-nsc-property-bar.
Sections (order and on/off under Settings > Site layouts, or per property on its Page tab):
| File | Data |
|---|---|
property/section/gallery.php |
id, label, media. Keep the data-nsc-carousel* hooks |
property/section/facts.php |
item, reviewsAnchor. With Highlights on it prints the highlights row (the built-in layouts print that row under the title and leave this section out), else four tiles |
property/section/description.php |
item, html (a function that cleans owner text) |
property/section/video.php |
video, tour ({provider, embed, url} or null), title |
property/section/amenities.php |
features (group to list of {id, title, icon}; icon is an icon name, already chosen) |
property/section/calendar.php |
island (the availability-calendar island) |
property/section/reviews.php |
reviews ({count, stars, categories, items, page_size} or null), more |
property/section/map.php |
item, island ('' without coordinates) |
property/section/faq.php |
id, faqs (list of {question, answer}) |
property/section/pois.php |
pois (list of {name, type, distance}) |
property/section/rules.php |
item, html |
property/section/cancellation.php |
terms (or null) |
property/section/enquiry.php |
island, captcha, captcha_id. Keep data-nsc-captcha. Printed only when "Ask a question" is inline |
property/section/similar.php |
cards (rendered cards) |
Each photo in media is {path, alt, caption, width, height}: the size is the image's
own in pixels, measured when the gallery is saved (or on the first page view), null when unknown.
Photo lightbox hooks (PhotoSwipe). With script, a click on a photo link opens the PhotoSwipe
lightbox; without script (or before it loads) the link keeps its href: the all-photos overlay
(#nsc-photos-<id>) or the full-size file. Print the hooks with
PropertyPageHtml::pswp($group, $index, $photo), the labels with PropertyPageHtml::pswpLabels().
| Attribute | On | Meaning |
|---|---|---|
data-nsc-pswp="<gallery>" |
a link | The gallery the link opens: nsc-photos-<id> (mosaic, photo column, all-photos overlay, "Show all photos") or the slider's id nsc-gallery-<id> |
data-nsc-pswp-index="<n>" |
a link | The photo it opens at (0 = the cover) |
data-pswp-src |
a link | The full-size image URL: the link is photo n of the gallery (the first link per index counts) |
data-pswp-width, data-pswp-height |
a link with data-pswp-src |
The image's size in pixels. Left out when unknown: the lightbox then takes the image's own size once it loads |
data-nsc-pswp-caption |
a link with data-pswp-src |
The photo's caption as plain text (tags dropped, one line, at most 300 characters), shown at the bottom of the lightbox. Left out when the photo has no caption: the caption bar is then hidden. Styled by .nsc-pswp-caption |
data-nsc-pswp-labels |
an element around the links (or any on the page) | JSON {close, prev, next, zoom, error}: the button labels |
A link with data-nsc-pswp but no data-pswp-src only opens the gallery (the "Show all photos"
buttons). Keep at least one link with data-pswp-src per photo, or that photo is not in the
lightbox. Sliders stay Swiper (data-nsc-carousel*); a tap on a slide opens the lightbox, a
swipe does not.
Availability calendar: calendar/
Used by the Availability calendar menu item and the Availability calendar list layout.
| File | Data |
|---|---|
calendar/grid.php |
id, rows, dates, from, days, today, prev, next, label, link, caption, at, island |
calendar/nav.php |
prev, next, label, link, days |
calendar/head.php |
dates (list of {date, weekday, day, month, weekend, today, label}) |
calendar/row.php |
row ({id, card, url, currency, days}) |
calendar/property.php |
row |
calendar/days.php |
id, days (list of {date, am, pm, arrival_ok, departure_ok, min_nights, price, known, past, pickable, classes, label}) |
calendar/legend.php |
none |
Hooks: data-nsc-cal on the calendar, data-nsc-cal-head, data-nsc-cal-days,
data-nsc-cal-from and data-nsc-cal-at for paging, data-nsc-cal-cell on every cell,
data-nsc-cal-day with data-arrival, data-departure, data-min, data-am and data-pm on
pickable days, tr[data-nsc-cal-property] with data-nsc-cal-url on each row,
a[data-nsc-cal-nav="prev|next"] and data-nsc-cal-label for the paging links, and
tbody[data-nsc-list-items]. Nightly prices are in each day's price, so an override can show
them.
Module layouts: module/
The properties, destinations and reviews modules print their content through these layouts.
Override these rather than the module's tmpl/default.php.
| File | Data |
|---|---|
module/properties/grid.php |
items (cards), card, columns, heading, id, label |
module/properties/list.php |
as grid |
module/properties/carousel.php |
as grid (cards show their cover only) |
module/properties/mosaic.php |
as grid (first card large) |
module/destinations/tiles.php |
tiles (list of {id, title, url, count, count_text, image}), columns, heading, show_count, ratio, id, label |
module/destinations/carousel.php |
as tiles |
module/reviews/slider.php |
reviews, columns, heading, show_property, id, label |
module/reviews/grid.php |
as slider |
module/part/carousel.php |
slides (HTML), id, label, columns |
module/part/destination.php |
tile, heading, show_count, ratio |
module/part/review.php |
review (with excerpt and property {id, title, url}), heading, show_property |
Each destination tile carries data-nsc-location="<id>" and each review data-nsc-review="<id>".
Carousel hooks: data-nsc-carousel, data-nsc-carousel-viewport, data-nsc-carousel-prev,
data-nsc-carousel-next and data-nsc-carousel-pagination. Without script the row is a native
swipe row. With script it gets arrows and dots.
Photos: image/picture.php
Every property photo on the public site (cards, the property page's slider, mosaic, photo column
and all-photos list, destination tiles) is printed by one layout, image/picture.php. When the
photo has its smaller copies (see "Images" in the settings: AVIF and WebP copies at 400, 800, 1200,
1600 and 2400 pixels wide, never larger than the original) it prints a <picture> with one
<source> per format, AVIF first, and an <img> with the JPEG or PNG copies. The browser picks the
format it supports and the width it needs from sizes. Without copies (an external URL, or copies
not made yet) it prints the plain <img> of the original, as before.
Override it at templates/<template>/html/layouts/com_nextselfcatering/image/picture.php.
| Key | Type | What it is |
|---|---|---|
image |
ResponsiveImage | src, width, height (the original; width/height may be null), hasCopies(), sources() (list of {type, srcset}), fallbackSrc(), fallbackSrcset(), largest('webp') ({url, width, height} or null) |
alt |
string | The alt text (empty for a decorative photo) |
class |
string | Classes of the <img> (for example nsc-card-image) |
sizes |
string | The sizes attribute: how wide the photo shows at each screen width |
loading |
string | eager for the first photo in view, else lazy |
fetchpriority |
string | high, low, auto, or empty for none |
attrs |
string | Extra attributes of the <img>, already escaped. Keep them |
Hook: the <picture> has the class nsc-picture, styled display: contents, so CSS written
for the <img> (size, object-fit, position in the card) works the same with or without the
<picture> around it. If your CSS targets the photo with a child selector (a > img), write it
as a descendant selector (a img) instead.
In your own overrides of the card or property layouts, print a photo with
ImageHelper::picture($path, $alt, ['class' => ..., 'sizes' => ImageHelper::SIZES_CARD])
(NextSoftware\Component\NextSelfCatering\Site\Helper\ImageHelper). The lightbox opens the
largest WebP copy when there is one; Open Graph, schema.org and Smart Search keep the original.
Other layouts
| File | Data |
|---|---|
review/card.php |
review (rating, title, body, display_name, stayed, published, reply) |
review/stars.php |
value (0 to 5) |
review/summary.php |
stars, count, class, number, brackets |
cancellation/terms.php |
terms (title, description, deposit_refundable, tiers), heading |
emails/wrapper.php |
The frame around every email |
invoices/document.php, invoices/parts/* |
The invoice and credit note PDF |
owners/statement.php |
The owner statement PDF |
Module templates
| Module | Files | Keep |
|---|---|---|
mod_nextselfcatering_search |
default.php (bar), compact.php, stacked.php, default_field.php (one field, shared) |
Field names and form[data-nsc-search-form] (the script leaves empty fields out of the URL). Where, guests (with pets when both show), bedrooms and type render the component's search field parts. Pick the layout under the module's Advanced > Layout |
mod_nextselfcatering_map |
default.php |
The property-map island and the filter form's id. Where and guests render the component's search field parts |
mod_nextselfcatering_properties |
default.php |
The [data-nsc-recent] wrapper and the recently-viewed island (Recently viewed source) |
mod_nextselfcatering_destinations |
default.php |
Nothing special: the tiles are module/destinations/* |
mod_nextselfcatering_reviews |
default.php |
Nothing special: the reviews are module/reviews/* |
mod_nextselfcatering_calendar |
default.php |
The availability-mini island and its nsc-scope wrapper |
mod_nextselfcatering_wishlist |
default.php |
The wishlist island (mode counter) |
mod_nextselfcatering_currency |
default.php |
The currency-switcher island |
Hooks on the Properties list page
The list page (tmpl/properties/default.php, a normal Joomla view template) carries these hooks
for the properties-browse script. Keep them if you override that file:
| Hook | On |
|---|---|
data-nsc-properties-results |
The results wrapper (also carries data-nsc-query, the current filters) |
data-nsc-properties-pagination |
The pagination wrapper |
data-nsc-properties-count |
The "n properties" text |
data-nsc-properties-heading |
The page heading |
data-nsc-properties-chips |
The chips wrapper |
form[data-nsc-properties-sort] |
The sort form, with data-nsc-properties-sort-submit on its button |
Filter keys
These are the names in the address, in the filter form and in the search module. A layout must use the same names.
| Key | Values |
|---|---|
location |
Location id (its sub-locations are included) |
arrival, departure |
Y-m-d |
flex |
0 to 3: also try the stay this many days earlier or later |
guests, adults, children, infants, pets |
Numbers, 0 to 99 (infants 0 to 4). guests = adults + children; adults / children win over guests when given; infants never count |
bedrooms, bathrooms |
At least this many |
type[] |
Property types (or a comma list) |
features[] |
Feature ids; every one must match |
rating |
Lowest average stars |
price_min, price_max, price_mode |
Minor units; night (default) or total |
featured, offers, shortbreaks |
1 to filter |
mode |
instant or request |
changeover |
Arrival weekday, 0 (Sunday) to 6 |
sort |
default, featured, price, price_desc, title, bedrooms |
page, limit |
Paging |
Date fields and form checks
Every arrival and departure pair on the site is rendered as two native date inputs. The page
script swaps them for the date range picker: a button that opens two months (a full-screen sheet
on phones). Visitors without script, and pages served from the page cache, keep the native inputs.
Keep these hooks when you override a layout with dates (the filter's filter/part/core.php, the
search and map module templates):
<div data-nsc-date-range data-flex="1" data-nsc-validate="daterange">
<label data-nsc-date-native>Arrival
<input type="date" name="arrival" data-nsc-date-arrival>
</label>
<label data-nsc-date-native>Departure
<input type="date" name="departure" data-nsc-date-departure>
</label>
<label data-nsc-date-native>Flexible dates
<select name="flex" data-nsc-date-flex>…</select>
</label>
<p data-nsc-form-error hidden></p>
</div>
On the [data-nsc-date-range] block (all optional):
| Attribute | What it does |
|---|---|
data-property-id |
Shows that property's booked days, changeover days and minimum stay |
data-min / data-max |
First and last day the picker offers (default first day: today in the site's time zone) |
data-min-nights / data-max-nights |
Fewest and most nights the picker allows |
data-flex="1" |
Shows the flexible days as chips (Exact, ± 1, ± 2, ± 3) instead of the select |
data-label |
Accessible name of the picker button and its dialog |
data-placeholder |
Button text before dates are chosen |
data-inline="1" |
Months only, with no button or popover |
Inside it: input[data-nsc-date-arrival] and input[data-nsc-date-departure] (required),
select[data-nsc-date-flex] (optional), and [data-nsc-date-native] on each wrapper the script
hides. Keep the names: the script moves them to hidden inputs (data-nsc-date-hidden="arrival|departure|flex"),
so the form sends the same fields as before. The native inputs keep their value but lose their
name and are disabled. The picker mounts in div[data-nsc-date-picker], and the block gets
data-nsc-date-enhanced="1". Use that attribute to style the block once the picker is there (the
filter shows its "Dates" caption, [data-nsc-date-caption], only then). The picker's own parts
are [data-nsc-daterange], [data-nsc-daterange-trigger], [data-nsc-daterange-panel],
[data-nsc-daterange-flex], [data-nsc-daterange-clear] and [data-nsc-daterange-apply], with
day buttons [data-date].
Form checks. Put data-nsc-validate-form on a <form> to check it on submit, before it is sent:
| Hook | What is checked |
|---|---|
data-nsc-validate="daterange" on the date block |
Both dates or neither, departure after arrival, arrival not in the past, stay limits. Options: data-nsc-required, data-nsc-min-nights, data-nsc-max-nights, data-nsc-min-date, data-nsc-max-date |
required, min / max, minlength / maxlength, pattern, type="email", type="date" |
The same as the browser checks, with the site's own messages |
data-nsc-validate="phone" |
A phone number |
data-nsc-validate="skip" |
Leaves a field, or everything inside an element, out |
A message goes into [data-nsc-form-error]: the one inside the date block or the field's
[data-nsc-field] wrapper or label, or [data-nsc-form-error="<field name>"] anywhere in the form.
When there is none, the script adds one. A field in error gets aria-invalid and
aria-describedby, and its group gets data-nsc-invalid (style errors with it). The first problem
gets focus. Without script, the browser's own checks and then the server's apply.
Site events
The page script sends events as DOM CustomEvents on window, named
nextselfcatering:<event>. You need no API to listen:
window.addEventListener('nextselfcatering:properties:updated', (e) => {
console.log(e.detail.total, e.detail.query);
});
Inside a site extension you can also use window.NextSelfCatering.site.on(name, fn) and
.emit(name, detail).
| Event | Detail | Sent when |
|---|---|---|
ready |
{api} | The site script has started |
island:mounted |
{name, element} | An island has mounted |
properties:updated |
{url, total, page, pages, appended, query, facets} | The list loaded a page, a filter change or more cards. query holds the filters, with the keys above |
properties:hover |
{id} | The pointer or focus moved onto a card; {id: null} when it leaves the results |
properties:filter |
{query} | Send it to make the list load these filters (page 1). The filter and the map send it |
properties:navigate |
{url} | Send it to make the list load that address (same site only) |
calendar:month |
{propertyId, month} | The property calendar showed another month |
calendar:pick |
{propertyId, arrival, departure} | A stay was picked in the availability calendar |
wishlist:changed |
{ids, count, signedIn} | A property was added to or removed from the wishlist |
dates:change |
{arrival, departure, flex, complete, form, container} | Dates were chosen in a date picker. complete is false while only the arrival is chosen |
dates:apply |
{arrival, departure, flex, form, container} | The guest applied the dates (Apply, or a departure picked on a wide screen) |
party:change |
{party, form, container} | The guests popover closed with another party. party is {adults, children, infants, pets} |
form:synced |
{form} | The filter form was set from the list (a chip removed, Back). Enhanced fields read their inputs again; send it after setting a form yourself |
Theme variables
Every Next Self-Catering element sits inside an .nsc-scope element that sets these CSS
variables from Settings > Site theme, or from a menu item's or module's own preset:
--nsc-primary, --nsc-primary-contrast, --nsc-accent, --nsc-accent-contrast, --nsc-bg,
--nsc-text, --nsc-muted, --nsc-line, --nsc-soft, --nsc-radius, --nsc-shadow,
--nsc-shadow-lg, --nsc-success, --nsc-danger, --nsc-booked, --nsc-day-am,
--nsc-day-pm.
Use them in your own CSS so overrides follow the chosen colours and dark mode:
.my-badge { background: var(--nsc-accent); color: var(--nsc-accent-contrast); border-radius: var(--nsc-radius); }
Example: a card with the bedrooms first
- Copy
components/com_nextselfcatering/layouts/card/classic.phptotemplates/cassiopeia/html/layouts/com_nextselfcatering/card/bedrooms-first.php. - Change the markup. Keep
data-nsc-property,data-nsc-priceand the heart button. - Open Configure > Settings > Site layouts. Bedrooms First (cassiopeia) is now a card choice. Pick it there, or on a Properties list menu item.