Character Limit

General ShopSite user discussion
Post Reply
Wezza007
Posts: 38
Joined: Wed Sep 06, 2006 5:41 am
Location: Melbourne, Australia

Character Limit

Post by Wezza007 »

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!
robm
Posts: 463
Joined: Fri Aug 04, 2006 5:46 pm
Location: Connecticut
Contact:

Post by robm »

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.
LexiConn
[url=http://lexiconn.com]ShopSite Host[/url]
[url=http://lexiconn.com/whitepapers.html]How to Get the Most Out of ShopSite[/url]
JeremeD
Posts: 60
Joined: Sat Feb 10, 2007 4:20 pm
Location: Athens, GA
Contact:

Post by JeremeD »

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.
Wezza007
Posts: 38
Joined: Wed Sep 06, 2006 5:41 am
Location: Melbourne, Australia

Post by Wezza007 »

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!
Jim
Site Admin
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Post by Jim »

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?
Wezza007
Posts: 38
Joined: Wed Sep 06, 2006 5:41 am
Location: Melbourne, Australia

Post by Wezza007 »

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!
Jim
Site Admin
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Post by Jim »

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
Post Reply