Support Forums

limiting featured text description

This is a discussion on limiting featured text description within the Technical Support forums, part of the Technical Support Forums category; I would like to know if it's possible to truncate the text that is below the featured listing thumbnail. I ...


Go Back   68 Classifieds Forums > Technical Support Forums > Technical Support

This topic is resolved.

If you have a similar issue that this thread does not address, open a new related support topic.

 
Thread Tools Display Modes
Old 08-06-2008, 06:49 PM   #1
Member
 
Join Date: Jul 2008
Posts: 76
Rep Power: 11
centinel3 is on a distinguished road
Default limiting featured text description

I would like to know if it's possible to truncate the text that is below the featured listing thumbnail. I know that you can limit the description, but this limits the text in the list view as well. I would like to allow a longer description in list view, though when it appears in the 'featured' section of the home page, I would like to have it stay under the image and not hyper-extend the other images due to an abnormally long description. Any help would be appreciated.

chris
centinel3 is offline  
Old 08-06-2008, 08:50 PM   #2
curmudgeon
 
Join Date: Mar 2006
Posts: 5,343
Rep Power: 132
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

you will have to edit the smarty plugin....

/includes/classes/smarty/plugins/function.feature_listings_horizontal.php

as always, make a backup of it first.

Since the plugin only shows the title I assume that what you would like to shorten and since you didnt mention what version of 68C your using I cant be sure my example below is the same as yours but here is a rundown of what to do.

find this section of code...

Code:
$tmp = array(
	'id' => $row['id'],
	'image'=> $image,
	'title'=> $row['title'],
	'price'=> FormatCurrency($row['price']),
);
$loop[$i++] = $tmp;

and change it to look like this.....


Code:
$tmp = array(
	'id' => $row['id'],
	'image'=> $image,
	'title'=> $rest = substr("$row['title']", 0, 15),
	'price'=> FormatCurrency($row['price']),
);
$loop[$i++] = $tmp;
the number 15 at the end of the row indicates how many characters you want to display.

'title'=> $rest = substr("$row['title']", 0, 15),
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline  
Old 08-07-2008, 04:41 AM   #3
Genius At Work
 
bowers01's Avatar
 
Join Date: May 2008
Location: Geelong, Victoria, Australia
Posts: 1,074
Rep Power: 32
bowers01 is on a distinguished road
Default

Hi,
My code originally was exactly the same as yours and when I changed it the featured items just disappeared.
Any reasons why?
Cheers
__________________
Nick Bowers
68c v4.1.10 Developer Custom Template
bowers01 is offline  
Old 08-07-2008, 09:55 AM   #4
curmudgeon
 
Join Date: Mar 2006
Posts: 5,343
Rep Power: 132
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

Quote:
Originally Posted by bowers01
Hi,
My code originally was exactly the same as yours and when I changed it the featured items just disappeared.
Any reasons why?
Cheers
Probably because of the double quotes around the variable, try changing this line...


'title'=> $rest = substr("$row['title']", 0, 15),

to

'title'=> $rest = substr($row['title'], 0, 15),
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline  
Old 08-07-2008, 10:02 AM   #5
Genius At Work
 
bowers01's Avatar
 
Join Date: May 2008
Location: Geelong, Victoria, Australia
Posts: 1,074
Rep Power: 32
bowers01 is on a distinguished road
Default

Thanks.
Works like a charm.
Cheers
__________________
Nick Bowers
68c v4.1.10 Developer Custom Template
bowers01 is offline  
Old 08-07-2008, 12:05 PM   #6
Member
 
Join Date: Jul 2008
Posts: 76
Rep Power: 11
centinel3 is on a distinguished road
Default Works Great!!!

Thank you for your help. This is Perfect!!!
centinel3 is offline  
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Description text below image in RSS/external.php business Modules / Plugins / Modifications 1 07-02-2008 07:42 PM


All times are GMT -4. The time now is 09:58 PM.


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