Download & Extend

maximum title length displayed in similar block

Project:Similar By Terms
Version:6.x-1.9
Component:Miscellaneous
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

I would like to set the maximum length of the displayed titles in the similar block so that each title fits on one line. If the title does not fit, 3 points are added, for example: Title 1 ...
Now I have:
> Title 1 etcetc etc
etc etc.
> Title 2 etc etc
> Title 3

And I would like to show them like this:

> Title etcetc ...
> Title 2 etc etc
> Title 3

I think that this will look better.

Comments

#1

I had the same issue with this but resolved it in the template file. I copied the similiarterms.tpl.php file from the module directory into my theme directory and added this to my template file:

    foreach ($items as $node) {
      if (strlen($node->title) > 70) {
              $node->title = mb_substr($node->title, 0, 70)." ...";
      }
      $items_ls[] = l($node->title, 'node/'. $node->nid);

#2

@ schnippy

works great. Thanks!

#3

Status:active» closed (fixed)