WF-Links has an overview of its links with a shortened description text. When you use XLanguage and the language tags, this can lead to disastrous results, because the snipping does not take into account the boundaries of these tags.
Due to the unbalanced tags XLanguage will remove various other parts of your sites page.
The problem starts with /modules/wflinks/templates/wflinks_linkload.html which contains:
<div align="justify"><b><{$smarty.const._MD_WFL_DESCRIPTIONC}>b><br />
<{$link.description|truncate:256}>div>
So, after 256 characters the text is truncated.
One solution would be to remove the modifier, but this would then always display the whole text and makes the 'read in detail' link useless.
We want a teaser or introduction, followed by a main part. eg
[lang1]intro[/lang1][lang2]intro[/lang2][lang1]main[/lang1][lang2]main[/lang2]
The intro is used in the overview and the complete text (intro and main) is used in the detail view of the link.
Therefore this rough Smarty hack:
<div align="justify"><b><{$smarty.const._MD_WFL_DESCRIPTIONC}>b><br />
<{php}>
if ($len = max( strpos($this->_tpl_vars['link']['description'],'[/nl]'), strpos($this->_tpl_vars['link']['description'],'[/en]'), strpos($this->_tpl_vars['link']['description'],'[/fr]'), strpos($this->_tpl_vars['link']['description'],'[/de]')))
{
$this->assign('shortdescription', substr($this->_tpl_vars['link']['description'], 0, $len+5).' ...');
}
else
{
$this->assign('shortdescription', substr($this->_tpl_vars['link']['description'], 0, 256).' ...');
}
<{/php}>
<{$shortdescription}><{* $link.description|truncate:256 *}>div>
What it does: it looks up the positions of the language end tags (eg nl fr de en) and uses the length of the last tag for having the complete block with all intro's in the overview list. As fallback is provided that when no language tags are present the previous 256 limit is used to truncate the text.
It expects:
- that all your tags are used in the link description or none.
- that the intro parts (any language order) come first.
- only single tags are used and not the multi eg [lang1|lang2]