Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 How to style each line of a textarea list?
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: How to style each line of a textarea list?
Option 1:
Allow multiple values for the field, set delimiter to be  .
If all are the same format, use in Display Item Format

Code:
<span class="item">{VALUE}</span>

otherwise use the Format Map List to assign specific mappings.

Option 2:
If you wish to keep it to be a singular value, use the following as the Display Format

Code:
1
2
3
4
5
6
7
<span class="item">
<?=str_replace("\n", '</span><span class="item">',
 str_replace("\n\n", "\n",
   str_replace("\r",'',trim({VALUE}))
 )
)?>
</span>

May be an issue if the user decides to put multiple blank lines.
(this also assumes that the Display Parsing is set to Plaintext (without newlines))


My Blog
(This post was last modified: 05-18-2012 09:34 AM by ZiNgA BuRgA.)
05-18-2012 09:32 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
RE: How to style each line of a textarea list? - ZiNgA BuRgA - 05-18-2012 09:32 AM

 Standard Tools
Forum Jump: