How do I truncate the length of the listing titles

From JReviews Documentation
Jump to: navigation, search

If your listing titles are too big and they break your layout o your list pages (Blogview, Tableview, Thumbview), you can cut them of like this:


Open the list view theme file, depending on which view you use:

  • /listings/listings_blogview.thtml
  • /listings/listings_tableview.thtml
  • /listings/listings_thumbview.thtml


Replace this line:

<?php echo $Routes->content($listing['Listing']['title'],$listing)?>


With:

<?php echo $Routes->content($Text->truncate($listing['Listing']['title'],50),$listing)?>


This will make the titles 50 characters long and add "..." at the end.