- Details
- Written by: Viviana Menzel
- Category: Styles
- Hits: 2167
This page uses a child template with an own style and own favicons.
Bonus module override
F.A.Q.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Quis lectus nulla at volutpat. Tempor id eu nisl nunc. Dolor morbi non arcu risus quis. Tincidunt lobortis feugiat vivamus at augue eget. Suscipit adipiscing bibendum est ultricies integer. Ut etiam sit amet nisl purus in. Habitant morbi tristique senectus et. Nunc consequat interdum varius sit amet mattis vulputate enim. Sed risus ultricies tristique nulla aliquet enim. Elementum curabitur vitae nunc sed velit. Dui ut ornare lectus sit amet est placerat in egestas. Tellus in metus vulputate eu scelerisque felis. Neque ornare aenean euismod elementum nisi quis. Mattis aliquam faucibus purus in massa tempor nec feugiat. Morbi tristique senectus et netus et.
Scelerisque eu ultrices vitae auctor eu. Elit scelerisque mauris pellentesque pulvinar. Ultrices neque ornare aenean euismod elementum. Tortor at auctor urna nunc. Faucibus pulvinar elementum integer enim neque volutpat ac tincidunt vitae. Volutpat blandit aliquam etiam erat velit. Consequat ac felis donec et odio pellentesque diam volutpat. Viverra suspendisse potenti nullam ac tortor vitae purus faucibus ornare. Feugiat in fermentum posuere urna nec. Adipiscing at in tellus integer feugiat scelerisque. Enim ut tellus elementum sagittis vitae. Ut placerat orci nulla pellentesque dignissim enim sit amet. Dui id ornare arcu odio ut sem nulla pharetra. Mattis ullamcorper velit sed ullamcorper morbi tincidunt. Neque vitae tempus quam pellentesque. Dignissim convallis aenean et tortor at risus. Sit amet justo donec enim diam vulputate ut pharetra sit.
faq.php: alternative layout for mod_articles_news (Module Newsflash)
<?php
/**
* @package Joomla.Site
* @subpackage mod_articles_news
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
if (!$list) {
return;
}
?>
<?php foreach ($list as $item) : ?>
<?php $item_heading = $params->get('item_heading', 'h4'); ?>
<div class="faq">
<<?php echo $item_heading; ?> class="panel-title">
<button aria-expanded="false"><?php echo $item->title; ?> <i class="panel-icon"></i> </button>
</<?php echo $item_heading; ?>>
<div hidden="">
<?php echo $item->introtext; ?>
</div>
</div>
<?php endforeach; ?>
Javascript (user.js)
document.addEventListener("DOMContentLoaded", function(){
(function () {
const headings = document.querySelectorAll('.panel-title');
Array.prototype.forEach.call(headings, h => {
let btn = h.querySelector('button');
let target = h.nextElementSibling;
btn.onclick = () => {
let expanded = btn.getAttribute('aria-expanded') === 'true';
btn.setAttribute('aria-expanded', !expanded);
target.hidden = expanded;
}
});
})();
});
CSS (user.css)
/* Collapse */
.faq {
--color-contrast: #4e61ff;
margin-bottom: var(--s1);
}
.panel-title {
border-bottom: 2px solid;
cursor:pointer;
}
.panel-title button {
all: inherit;
border: 0;
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
padding: 0.5em 0;
}
.panel-title button:focus .panel-icon {
outline: 2px solid var(--color-contrast);
outline-offset: 4px;
}
.panel-icon {
width: 60px;
height: 60px;
text-align: center;
}
.panel-icon::before {
content: "+";
}
.panel-title [aria-expanded="true"] .panel-icon::before {
content: "-";
}