372
Views
1
Comments
Solved
Limit long text output in an expression inside a card
Question
Application Type
Reactive
Service Studio Version
11.53.4 (Build 60685)
Platform Version
11.16.0 (Build 35766)

Hi everyone. 

I have an OS11 -Reactive app. I'm using cards to show projects in a home page. 

The card is a "CardSectioned". And in the Content I have an expression which shows the description of the project from the DB.

If the Description is long, the card becomes long (Image 1) and the requirement is for all the cards to have the same height. 

BUT if I limit the height, then the description is lost (image 2).



The widget tree shows the card structure. In the properties, I'm limiting the height of the entire card with a " height: 14rem;" inside a class (red circle). And the expression has the long description (orange circle), and I'm trying to limit the container height in the Styles CSS tab or also via a simmilar .class with a lower rem. But still no good.

How can I limit the text that is shown inside the content-container? so that it only shows a certain number of chars and then 3 dots "..." or any other way that I could keep the cards with the same height and the text contained inside the container?

I appreciate any help, thanks!


Image1.jpg
2021-06-02 20-50-04
Márcio Carvalho
Solution

You can see this post.

https://www.outsystems.com/forums/discussion/62806/how-to-truncate-dropdown-text-with-ellipsis-in-mobile/

Or you can calculate yourself the number of chars

If(length(expression)>NrOfChars,Substr(expression,0,NrOfChars)+"...", expression)

Like in this post

https://www.outsystems.com/forums/discussion/50824/long-text-title/

Something like this.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.