Skip to content

Instantly share code, notes, and snippets.

@hans2103
Created June 6, 2019 11:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hans2103/7f73245f522a45e9d0414eca146741e3 to your computer and use it in GitHub Desktop.
Save hans2103/7f73245f522a45e9d0414eca146741e3 to your computer and use it in GitHub Desktop.
Joomla alternate layout mod_articles_category for Bootstrap 3 Slideshow
<?php
/**
* @package Joomla.Site
* @subpackage mod_articles_category
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
$count = count($list);
?>
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<?php for ($i = 0; $i < $count; $i++) : ?>
<li data-target="#carousel-example-generic" data-slide-to="<?php echo $i; ?>"
class="<?php echo $i == 0 ? 'active' : ''; ?>"></li>
<?php endfor; ?>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<?php for ($i = 0; $i < $count; $i++) : ?>
<?php $images = json_decode($list[$i]->images); ?>
<div class="item <?php echo $i == 0 ? 'active' : ''; ?>">
<?php /*<img src="<?php echo htmlspecialchars($images->image_intro); ?>" alt="">*/ ?>
<img src="https://picsum.photos/700/300" alt="">
<div class="carousel-caption">
<?php if ($params->get('item_title')) : ?>
<h4><?php echo $list[$i]->title; ?></h4>
<?php endif; ?>
<?php echo $list[$i]->introtext; ?>
</div>
</div>
<?php endfor; ?>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment