Answer the question
In order to leave comments, you need to log in
How to list categories alphabetically?
Hello, I have this code
<?php foreach ($this->intro_items as &$item){
$counter_material +=1;
$its_a_end = 0;
if($counter_material==1){
$counter_column +=1;
echo '<div class="columns column-'.$counter_column.'">';
if($first_letter==substr($item->title,0,1)){
echo '<div class="arhiv_content obchi">';
}
}
if($first_letter!=substr($item->title,0,1)){
$first_letter = substr($item->title,0,1);
// echo '-||'.$counter_material.'||-';
if($counter_material>1) echo '</div>';
echo '<h3 class="arhiv_letter">'.$first_letter.'</h3>';
echo '<div class="arhiv_content neobchi">';
}
?>
<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catid)); ?>">
<span>
<?php echo $item->title; ?>
</span>
</a>
<?php
//echo $counter_material.' >= '.$num_materail_in_column.' || '.$counter_material.' >= '.$num_links."\n";
//echo $counter_material.'>='.count($this->intro_items)."\n";
if($counter_material >= $num_materail_in_column||$counter_material>=count($this->intro_items)){
$counter_material = 0;
$its_a_end = 1;
echo '</div>';
echo '</div>';
}
};
if(!$its_a_end){
echo '</div>';
echo '</div>';
}
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question