Character Limit

General ShopSite user discussion

Character Limit

Postby Wezza007 » Sat Feb 03, 2007 11:17 pm

Is it possible to place a tag in a template but to limit the number of characters?

For example, I may just want to display the first 50 characters of [-- PRODUCT.MoreInformationText --]

The reason I want to do this is in my search results where I just want to show a teaser of the information available and then the customer has to click into the product to read more about it?
Goodbye Agassi!
Wezza007
 
Posts: 38
Joined: Wed Sep 06, 2006 5:41 am
Location: Melbourne, Australia

Postby robm » Mon Feb 05, 2007 6:16 pm

I am not aware of any ShopSite tag that could do this. You could use the "CALL" tag in ShopSite to call a perl script that truncates the description to X characters and then returns the truncated text probably.
robm
 
Posts: 463
Joined: Fri Aug 04, 2006 5:46 pm
Location: Connecticut

Postby JeremeD » Sat Feb 10, 2007 4:28 pm

If you want to do this specifically for the search results ShopSite has a built in function.

It's under Preferences -> Search Settings -> Search Layout -> "Maximum number of character..."

Unfortunately, there is no function to do this on other pages. However, I wrote a small function to do this for me a while back using PHP.
JeremeD
 
Posts: 60
Joined: Sat Feb 10, 2007 4:20 pm
Location: Athens, GA

Postby Wezza007 » Sun Feb 11, 2007 2:42 am

Thanks very much... that's extremely helpful and exactly what I was looking for. It's saved me a lot of time for my search results.

The only bug I need to work out now is that my descriptions have a bit of garbage in them:

eg: Racquet Summary|n| The|n| RDX 300 is available in Mid Plus and Super|n| Mid. These|n| ...

I've specified "no HTML" in the tag, but I keep getting these |n| characters. What are they? How do I stop them appearing without having to modify every description I've done?
Goodbye Agassi!
Wezza007
 
Posts: 38
Joined: Wed Sep 06, 2006 5:41 am
Location: Melbourne, Australia

Postby Jim » Sun Feb 11, 2007 11:14 am

The |n| characters are internal database representation of carriage returns in your text. These should not be displaying on store pages. What version of ShopSite are you using? And on what type of page are they displaying?
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Postby Wezza007 » Wed Feb 14, 2007 4:25 am

I'm using Shopsite Version 8.1.2 and they are only displaying in my search results. They do not display on the regular product pages.
Goodbye Agassi!
Wezza007
 
Posts: 38
Joined: Wed Sep 06, 2006 5:41 am
Location: Melbourne, Australia

Postby Jim » Wed Feb 14, 2007 6:53 am

You need to have your store upgraded to 8.1.3. See this kbase article which mentions a fix in search for linefeed characters in search results.

http://support.shopsite.com/kbase/view_ ... onID=S5518
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah


Return to User Forum

Who is online

Users browsing this forum: No registered users and 120 guests