How to limit a text display

12 years 3 months ago #187667 by jakobe75
How to limit a text display was created by jakobe75
I want a short description to appear in one of my CB-lists columns.

this description is written by the profile owner...but the amount of text I allow them to display on their actual profile is far longer than what can be effectively displayed on a cb list.

so would it better to....

A. Limit the amount of text that is displayed on the CBlist column.

or

B. Create another field/tab that only shows up to the user upon profile edit and then tell them that this is their customizable "search description" or something to that nature.


Is there even a way of limiting by character count what a delimiter or any other feild can display on a cblist?

?

Please Log in to join the conversation.

12 years 3 months ago #187702 by krileon
Replied by krileon on topic Re: How to limit a text display
You could use incubator project CB Query Field and query the database directly for the fields value which would let you use database functions to cut the text short. Example as follows.
SELECT CONCAT( TRIM( LEFT( `cb_text`, 20 ) ), '...' ) FROM `#__comprofiler` WHERE `user_id` = [user_id]

With the above it'll return the first 20 characters of field cb_text then add ... to the end after trimming trailing spaces.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: pepperstreet

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.257 seconds

Facebook Twitter LinkedIn