kenmcd wrote: .
How did you modify the alpha-index to lump the numbers into the "#" sign.
I, and I am sure a number of other users, would like to have that template modification.
Here's what I have for the code in category_alpha.php...
Code:
<?php
/**
* @version 1.5 beta 5 $Id: blog_alpha.php 85 2009-10-10 13:48:04Z vistamedia $
* @package Joomla
* @subpackage FLEXIcontent
* @copyright (C) 2009 Emmanuel Danan - www.vistamedia.fr
* @license GNU/GPL v2
*
* FLEXIcontent is a derivative work of the excellent QuickFAQ component
* @copyright (C) 2008 Christoph Lukes
* see www.schlu.net for more information
*
* FLEXIcontent is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
?>
<div class="alpha-wrapper">
<ul id="alpha-index-<?php echo $this->category->id; ?>" class="alpha-index">
<li class="alpha-first"><h3>Alphabetic Index</h3></li>
<li class="alpha-letter"><a id="letter-all" href="#" onclick="document.getElementById('alpha_index').value='';document.getElementById('adminForm').submit();"><span>*</span></li>
<?php
$letters = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z');
foreach ($letters as $letter) :
if (in_array($letter, $this->alpha)) :
echo "<li class=\"alpha-letter enabled\"><a id=\"letter-".$letter."\" href=\"#\" onclick=\"document.getElementById('alpha_index').value='".$letter."';document.getElementById('adminForm').submit();\"><span>".strtoupper($letter)."</span></li>";
else :
echo "<li class=\"alpha-letter disabled\"><span>".strtoupper($letter)."</span></li>";
endif;
endforeach;
?>
<li class="alpha-last"><span>0-9</span></li>
</ul>
</div>
And the category.css...
Code:
/*
* alpha-index
*/
div.alpha-wrapper{ float: left; height:42px; width: 100%; margin: 0; clear: both; overflow: hidden; background: url('../images/alpha-index.png') top center no-repeat;}
ul.alpha-index {
height: 30px;
list-style-type: none;
top: 0;
margin: 0 auto;
width: 60%;
overflow: hidden;
}
.alpha-index li.alpha-first{
position: absolute;
height: 30px;
width: 15px;
left: 0;
margin-left: -15px;
padding-left: 0;
}
.alpha-index li.alpha-first+li{
border-left: 1px solid #fff;
}
.alpha-index li.alpha-first h3{
display: none;
}
.alpha-index li {
display: inline-block;
line-height: 30px;
margin: 0;
padding: 0px 5px 0px 5px;
border-right: 1px solid #fff;
}
.alpha-index li a span{
display: inline-block;
line-height: 30px;
}
.alpha-index a:link, .alpha-index a:visited, .alpha-index li a#letter-all {
color: #FFF;
text-decoration: none;
}
li.alpha-letter:hover{
background-color: #71899d;
}
.alpha-index a:hover {
color: #FFF;
text-decoration: none;
background-color: #71899d;
}
.alpha-index a:active{
}
.alpha-index span {
cursor: pointer;
}
.alpha-index li.alpha-last{
position: absolute;
height: 30px;
width: 20px;
top: 0;
right: 0;
margin-right: -20px;
}
.alpha-index li.alpha-last span{
display: none;
}
.alpha-index li.disabled{
color: #0e2b44;
}
.alpha-index li.disabled:hover{
background-color: transparent;
}
Basically it's the document.getElementById('alpha_index').value='' that gets the job done.
An interesting issue has arisen though now that I'm revisiting the code. In another thread on these forums a user asked about sorting international characters without adding the individual characters to the alpha list so if someone pressed O they'd also get Ò, Ó and Ô etc...
Though technically completely different individual characters it might be helpful to include such functionality.
As you probably became aware in your modification the strtoupper call isn't cut out for internationalization issues. I'm now trying to put my head around the issues on the front-end such as the array list, should you have something like
Code:
$letters = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', array('o','Ò','Ó'), 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z');
Use the first one for display but the others for comparison to enable/disable the O. Or use JLanguage::transliterate to compare.
How did you build your list, from the language ini's?
Jw