-
-
Save jover2015/f92772b4169bc15b113c0eca119a7489 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 - 2015 Open Source Matters, Inc. All rights reserved. | |
* @license GNU General Public License version 2 or later; see LICENSE.txt | |
*/ | |
defined('_JEXEC') or die;?> | |
<?php $arr = array(); | |
$items = $this->link_items; | |
foreach ($items as $key => $value) { | |
//echo $value['name']; | |
if(!in_array($value->title[0], $arr)){ | |
array_push($arr, $value->title[0]); | |
} | |
} | |
echo '<div class="index-zeile">'; | |
foreach($arr as $letter) { | |
echo '<a class="btn" data-link="letter-'.$letter.'" href="#letter-'.$letter.'" />'.$letter.'</a>'; | |
} | |
echo "</div>"; | |
echo | |
'<ul class="accordion">'; | |
foreach ($arr as $key => $group) { | |
echo | |
'<li id="letter-'.$group.'" class="letter-anchor" > | |
<div class="panel panel-default"> | |
<div class="panel-heading"> | |
<h4 class="panel-title"> | |
<a href="#'.$group.'" data-toggle="collapse">'.$group.'</a> | |
</h4> | |
</div>'; | |
echo | |
'<div id="'.$group.'" data-link="letter-'.$group.'" class="panel-collapse collapse"> | |
<ul class="list-group" >'; | |
foreach ($items as $key => $value) { | |
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)); ?>"> Mehr darüber</a> | |
</div> | |
</div> | |
</li> | |
<?php endif; | |
} | |
echo | |
'</ul>'; | |
echo | |
'</div> | |
</li>'; | |
} | |
echo | |
'</ul>'; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment