Support Forums

Old 03-11-2009, 04:06 AM   #1
Junior Member
 
Join Date: Sep 2008
Posts: 9
Rep Power: 0
Abdulaziz is on a distinguished road
Default how to solve damage in the style

hello

i would like to know if there way to solve the damage in the style when the user type in the description field 72 number of word in the same line in his ad . the style would affected for this line so i would like to avoid this problem
note: i am useing 3 column style
thanks in advance
Abdulaziz is offline   Reply With Quote
Old 03-11-2009, 09:05 AM   #2
Moderator
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 1,201
Rep Power: 36
Mike-N-Tosh is just really niceMike-N-Tosh is just really nice
Default

I know how frustrating this is because it causes the table to auto expand even if you have a set width in place.

Here's what I have done for many of my clients to resolve this particular issue:
{$entry.description|truncate:120:"...":false:false }

The 120 is the total number of characters including the "..." that will show. the "..." is the suffix that will show if the field is indeed truncated. The false:false are options that tell it to complete words and to put the suffix at the end instead of the middle.

The result is something like this:

blah, blah, blah, blah...

This is a smarty built in function. Smarty

Hope that helps,
-Mike
__________________
Mike-N-Tosh
v3.1.10 Developer IndianaPC.org - A community website
Sandbox v4.0.9, 4.1
Templates, Mods & Docs for sale | My blog with much content for 68 Classifieds.
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline   Reply With Quote
Old 03-12-2009, 09:02 AM   #3
Senior Member
 
 
Join Date: Jan 2007
Posts: 278
Rep Power: 14
michael is on a distinguished road
Default

{$entry.description|truncate:120:"...":false:false }

Hi Mike, where would you place this?
__________________
v4.1 Developer


"All truths are easy to understand once they are discovered; the point is to discover them" - Galileo Galilei (1564 - 1642)
michael is offline   Reply With Quote
Old 03-12-2009, 09:58 AM   #4
Moderator
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 1,201
Rep Power: 36
Mike-N-Tosh is just really niceMike-N-Tosh is just really nice
Default

Quote:
Originally Posted by michael View Post
{$entry.description|truncate:120:"...":false:false }

Hi Mike, where would you place this?
You would place that in the template file where the offending field is. The example given may not be the best, because the "description" field isn't shown in showlistings(2).tpl, but I have had several customers want the description in the that file.

Example for showlistings2.tpl replacing the "shortDescription" field with "Description field around line 105.
Find this:
HTML Code:
<tr>
   <td colspan="3" width="100%"{if $entry.class<>""} class="{$entry.class}"{/if}>
   {$entry.shortDescription}  
   <a href="{$entry.link}" title="{$entry.title}">more</a></td>
</tr>
Replace with this:
HTML Code:
<tr>
   <td colspan="3" width="100%"{if $entry.class<>""} class="{$entry.class}"{/if}>
   {$entry.description|truncate:120:"...":false:false}  
   <a href="{$entry.link}" title="{$entry.title}">more</a></td>
</tr>
-Mike
__________________
Mike-N-Tosh
v3.1.10 Developer IndianaPC.org - A community website
Sandbox v4.0.9, 4.1
Templates, Mods & Docs for sale | My blog with much content for 68 Classifieds.
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nu Style Conifer (4.1X) seymourjames Modification Release 0 03-05-2009 11:22 AM
Nu Style Ruby (4.1X) seymourjames Modification Release 4 03-01-2009 08:24 AM
Nu Style Plum (4.1X) seymourjames Modification Release 0 02-19-2009 04:19 PM
Nu Style Ocean (4.1X) seymourjames Modification Release 0 02-19-2009 04:19 PM
Water Damage Eric Barnes Off Topic 10 10-23-2007 11:15 PM


All times are GMT -4. The time now is 08:54 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0