Customisation
Overriding Core Layouts per Section
Core layouts such as the alpha index (components/com_joomcck/layouts/core/markup/alphaIndex.php) and "On this page" (components/com_joomcck/layouts/core/list/onThisPage.php) can be overridden for one section.
Create a folder in components/com_joomcck/layouts/apps/ named after the section alias in camel case (knowledge-base becomes knowledgeBase) and copy the layout there:
components/com_joomcck/layouts/apps/knowledgeBase/markup/alphaIndex.php
components/com_joomcck/layouts/apps/knowledgeBase/list/onThisPage.php
Record Buttons
Bookmark, follow, repost, compare, print and edit each have their own layout:
components/com_joomcck/layouts/core/list/recordParts/buttonBookmark.php (also buttonFollow, buttonRepost, buttonCompare, buttonEdit)
components/com_joomcck/layouts/core/single/recordParts/buttonBookmark.php (also buttonFollow, buttonRepost, buttonPrint, buttonEdit)
buttonsManage.php in each folder only calls these layouts in order.
Render one button anywhere in a custom template:
<?php echo \Joomcck\Layout\Helpers\Layout::render(
'core.list.recordParts.buttonBookmark',
['record' => $item, 'type' => $submissionTypes[$item->type_id], 'params' => $params]
); ?>
| Layout | Data keys |
|---|---|
buttonBookmark |
record, type, params |
buttonFollow |
record, section, params (optional) |
buttonRepost |
record, section |
buttonCompare |
record, type, section |
buttonPrint |
record, params (optional) |
buttonEdit |
record, type, section |
Each layout outputs nothing when the visitor has no permission. Turn on Edit button in the template settings to show the edit button inline.
To change one button site-wide, put an override in your Joomla template:
templates/<your-template>/html/layouts/core/list/recordParts/buttonBookmark.php
or for one section in components/com_joomcck/layouts/apps/<sectionName>/list/recordParts/.
Raw Button Values
To build your own markup, ask HTMLFormatHelper for the values. Each returns an array, or null when the visitor may not use the button:
| Method | Keys |
|---|---|
bookmarkData($record, $type, $params) |
state, pack, icon, alt, tip, id, onclick, sectionId |
followData($record, $section, $params) |
state, pack, icon, alt, tip, id, onclick, sectionId |
repostData($record, $section) |
icon, alt, tip, id, onclick, sectionId |
compareData($record, $type, $section) |
icon, alt, tip, id, hidden, onclick, sectionId |
printData($record, $params) |
url, tip, onclick |
editData($record, $type, $section) |
href, label, icon |
<?php if ($d = HTMLFormatHelper::bookmarkData($item, $submissionTypes[$item->type_id], $params)): ?>
<a href="#" class="my-bookmark" onclick="<?php echo $d['onclick']; ?>">
<img src="/<?php echo $d['icon']; ?>" alt="<?php echo $d['alt']; ?>">
</a>
<?php endif; ?>
Settings Menu
The record settings dropdown has its own layout, layouts/core/list/recordParts/controlsMenu.php and layouts/core/single/recordParts/controlsMenu.php. It receives $controls and $record. The Modern UI uses its Tailwind versions under layouts/modern/, picked automatically.
Filter Icons
The author and type funnel links use layouts/core/list/recordParts/recordFilter.php. Change the icons per template with Author filter icon and Type filter icon.
Icon Packs for Bookmark and Follow
Packs live in media/com_joomcck/icons/bookmarks/<pack>/ and media/com_joomcck/icons/follow/<pack>/, each with state0.png (off) and state1.png (on). Bookmark ships with star, bookmark and tick; follow with default.
Add a pack by creating the folder with the two images (Media Manager or FTP), or upload a ZIP straight from the Bookmark icons / Follow button icons setting in the section template: enter a pack name, pick the ZIP and click Upload. The upload needs JoomCCK manage rights, accepts image files only and writes only inside media/com_joomcck/icons/.