Difference between revisions of "How to update Alphaindex bar with characters from other languages"

From JReviews Documentation
Jump to: navigation, search
Line 20: Line 20:
  
 
You can add the code for your custom letters above or below that code.
 
You can add the code for your custom letters above or below that code.
 +
 +
For example, adding these two lines of code will include the '''α''' and '''β''' characters from the Greek alphabet:
 +
 +
<source lang="php">
 +
<?php $options[] = $Routes->alphaindex('α','α',$directory,array('class'=>'jrButton','rel'=>'nofollow'));?>
 +
<?php $options[] = $Routes->alphaindex('β','β',$directory,array('class'=>'jrButton','rel'=>'nofollow'));?>
 +
</source>
 +
 +
 +
 +
[[Category:JReviews]]
 +
[[Category:Directory]]

Revision as of 16:49, 15 July 2016

JReviews Directory pages display an alphabetical index bar on top of the page:

Alphaindex.png

When visitors click on a specific letter, they will get all listings in a directory that begin with the letter.

By default only letters from the english alphabet are included. If you want to include additional letters from your language, you will need to update the theme file of the alphaindex bar which is located here:

/jreviews/views/themes/default/elements/alphaindex.thtml

Before making any theme changes, make sure you copy the theme file into your custom theme in JReviews Overrides.

If you open the file, you will find this loop which generates the english letter:

<?php for ($i=65; $i<= 90; $i++):?>
	<?php $options[] = $Routes->alphaindex(chr($i),strtolower(chr($i)),$directory,array('class'=>'jrButton','rel'=>'nofollow'));?>
<?php endfor;?>

You can add the code for your custom letters above or below that code.

For example, adding these two lines of code will include the α and β characters from the Greek alphabet:

<?php $options[] = $Routes->alphaindex('α','α',$directory,array('class'=>'jrButton','rel'=>'nofollow'));?>
<?php $options[] = $Routes->alphaindex('β','β',$directory,array('class'=>'jrButton','rel'=>'nofollow'));?>