News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

Conditional formatting text color depending on text itself

Started by michaelj1103, May 19, 2022, 06:21:57 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

michaelj1103

I was wondering if it was possible for format the character color based off of the actual text itself? So for example, if the text contained the characters 123, then it would change all the characters red. So the text ABC123 would look like that. And if 123 was not in the text then it would just be Black. Thanks.

Surrogate

#1
Quote from: michaelj1103 on May 19, 2022, 06:21:57 PMI was wondering if it was possible for format the character color based off of the actual text itself? So for example, if the text contained the characters 123, then it would change all the characters red. So the text ABC123 would look like that. And if 123 was not in the text then it would just be Black.
If I understand the condition correctly: if the length of the text sequence is more than 3 characters and the last three characters are 123, then the font is red (value 2). In all other cases the font is black (value 0).
You must activate Developer mode, and open ShapeSheet environment window (hope this video can helps, just see first minute).
In ShapeSheet window scroll and find Character section.

Write formula [tt]IF(AND(STRSAME(RIGHT(SHAPETEXT(TheText),3),"123"),LEN(SHAPETEXT(TheText))>3),2,0)[/tt] in cell Color in Character section.


michaelj1103


Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 205 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1054KB.
Tokens: post-login.
Cache hits: 14: 0.00169s for 26,766 bytes (show)
Cache misses: 3: (show)
Queries used: 16.

[Show Queries]