There might be times, when you want to shorten the article title.
Example --> relation (child/parent) list template.
Adding the following code will solve this - it will display the shortened title in full in a tooltip. The number of characters can be changed in the template parameter.
Add parameter to XML
<field name="title_char" label="Number of Title Characters" type="text" size="3" default="" />
Replace line 309-315 in advanced table template
<?php if(in_array($params->get('tmpl_core.item_link'), $this->user->getAuthorisedViewLevels() ) ) :?>
<a <?php echo ($params->get('tmpl_core.title_char') && (strlen($item->title) > $params->get('tmpl_core.title_char') ) ? 'rel="tooltip" data-original-title="'.$item->title.'"': NULL)?>
<?php echo $item->nofollow ? 'rel="nofollow"' : '';?> href="/<?php echo JRoute::_($item->url);?>"
>
<?php if ($params->get('tmpl_core.title_char') ) :?>
<?php echo substr($item->title,0,$params->get('tmpl_core.title_char') ).(strlen($item->title) > $params->get('tmpl_core.title_char') ? "..." : NULL);?>
<?php else:?>
<?php echo $item->title?>
<?php endif;?>
</a>
<?php else :?>
<?php if ($params->get('tmpl_core.title_char') ):?>
<span <?php echo ($params->get('tmpl_core.title_char') && (strlen($item->title) > $params->get('tmpl_core.title_char') ) ? 'rel="tooltip" data-original-title="'.$item->title.'"': NULL)?>>
<?php echo substr($item->title,0,$params->get('tmpl_core.title_char') ).(strlen($item->title) > $params->get('tmpl_core.title_char') ? "..." : NULL) ;?>
</span>
<?php else:?>
<?php echo $item->title?>
<?php endif;?>
<?php endif;?>
There might be times, when you want to shorten the article title.
Example --> relation (child/parent) list template.
Adding the following code will solve this - it will display the shortened title in full in a tooltip. The number of characters can be changed in the template parameter.
Add parameter to XML
Replace line 309-315 in advanced table template