How to Limit the amount of Characters in 'Post By' Column:

CritiKiL

Active member
#1
This code provides the ability to 'limit' the amount of characters in the 'Recent Posts' column and I would like to do the same for the 'Posted By' column:
Code:
<tr class="dataRow">
<td><a href="{xen:link 'posts', $post}" class="Tooltip" title="{$post.title}">{xen:helper wordTrim,{$post.title}, 30}</a></td>
<td><xen:username user="$post" rich="true" />
<div class="userTitle">{xen:helper userTitle, 'username', $post}</div></td>
<td><xen:datetime time="$post.post_date" class="muted" /></td>
<td><a href="{xen:link 'forums', $post}">{$post.node_title}</a></td>
</tr>
I just need to know how to phrase it properly using the "wordTrim". Can anyone help? Thanks in Advance ;-)

BTW: The reason is because on a mobile phones-view, a posters name that is larger than 10 characters stretches my set width.
 

Attachments

James

Well-known member
#2
{xen:helper wordTrim,{variableToTrim}, maxLength}

{xen:helper wordTrim,{$post.author}, 10} is probably what you're looking for.

If not author, probably username.
 

CritiKiL

Active member
#3
{xen:helper wordTrim,{variableToTrim}, maxLength}

{xen:helper wordTrim,{$post.author}, 10} is probably what you're looking for.

If not author, probably username.
Yea, neither of those ($post.author / $post.username) did the trick...
 

James

Well-known member
#4
<div class="userTitle">{xen:helper userTitle, 'username', $post}</div></td>

Replace with:
<div class="userTitle">{xen:helper wordtrim, {xen:helper userTitle, 'username', $post}, 10}</div></td>

That should work, though untested.
 

CritiKiL

Active member
#5
<div class="userTitle">{xen:helper userTitle, 'username', $post}</div></td>

Replace with:
<div class="userTitle">{xen:helper wordtrim, {xen:helper userTitle, 'username', $post}, 10}</div></td>

That should work, though untested.
Still nothing. Changed it to include your suggestion below:
HTML:
<tr class="dataRow">
<td><a href="{xen:link 'posts', $post}" class="Tooltip" title="{$post.title}">{xen:helper wordTrim,{$post.title}, 30}</a></td>
<td><xen:username user="$post" rich="true" />
<div class="userTitle">{xen:helper wordtrim, {xen:helper userTitle, 'username', $post}, 10}</div></td>
<td><xen:datetime time="$post.post_date" class="muted" /></td>
<td><a href="{xen:link 'forums', $post}">{$post.node_title}</a></td>
</tr>
That's why I made a thread because it looks simple, but somethings not giving ;-(
 

CritiKiL

Active member
#7
Yes, it's an addon but the creator does not provide support and there's nothing wrong as it was not intended to be perfectly 'mobile-functional', so I'm trying to tweak it because our community views mostly from our smartphones and tablets.
 
Top