-
-
Save zero-24/87faf4a28f61ff8584942be63e94601d to your computer and use it in GitHub Desktop.
Alphaindex für Kategorie-Link
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @package Joomla.Site | |
* @subpackage com_content | |
* | |
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved. | |
* @license GNU General Public License version 2 or later; see LICENSE.txt | |
*/ | |
defined('_JEXEC') or die; | |
$arr = array(); | |
$items = $this->link_items; | |
foreach ($items as $key => $value) | |
{ | |
if (!in_array($value->title[0], $arr)) | |
{ | |
array_push($arr, $value->title[0]); | |
} | |
} | |
?> | |
<div class="index-zeile"> | |
<?php foreach($arr as $letter) : ?> | |
<a class="btn" data-link="letter-' . <?php echo $letter; ?> . '" href="#letter-' . <?php echo $letter; ?> . '" />' . <?php echo $letter; ?> . '</a> | |
<?php endforeach; ?> | |
</div> | |
<ul class="accordion"> | |
<?php foreach ($arr as $key => $group) : ?> | |
<li id="letter-' . <?php echo $group; ?> . '" class="letter-anchor"> | |
<div class="panel panel-default"> | |
<div class="panel-heading"> | |
<h4 class="panel-title"> | |
<a href="#' . <?php echo $group; ?> . '" data-toggle="collapse">' . <?php echo $group; ?> . '</a> | |
</h4> | |
</div> | |
<div id="' . <?php echo $group; ?> . '" data-link="letter-' . <?php echo $group; ?> . '" class="panel-collapse collapse"> | |
<ul class="list-group"> | |
<?php foreach ($items as $key => $value) : ?> | |
<?php if ($value->title[0] == $group) : ?> | |
<li class="list-group-item"> | |
<div> | |
<h4><a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($value->slug, $value->catid, $value->language)); ?>"> | |
<?php echo $value->title; ?></a> | |
</h4> | |
</div> | |
<div> | |
<div class="readmore-btn"> | |
<a class="read-more" href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($value->slug, $value->catid, $value->language)); ?>"> | |
<?php echo JText::_('COM_CONTENT_READ_MORE_TITLE'); ?> | |
</a> | |
</div> | |
</div> | |
</li> | |
<?php endif; ?> | |
<?php endforeach; ?> | |
</ul> | |
</div> | |
</li> | |
<?php endforeach; ?> | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment