Jump to content

Creating Bullets from Multi-line Text Field


rjohns

Recommended Posts

I'm working on a template and need to create a list of bullets. I know I could do this with multiple fields (bullet 1, bullet 2, bullet 3, etc.), but I'm hoping there is a way I can do it using one field with multi-line text entry. It'd be way more user-friendly for my users to be able to cut and paste an entire list from the source content into one field instead of having to cut and paste into multiple fields.

 

Ideally, a user would be able to type a list into the field using paragraph breaks (pressing "Enter") to distinguish between the bullets.

 

Here's that I'm doing right now:

return '•<t>' + Field("Bullets");

 

But that's only displaying a bullet at the beginning of the entire field. I need to insert the bullet and tab at the beginning of every line.

 

Any help would be greatly appreciated – thanks!

Link to comment
Share on other sites

I found a solution ... Thought I would post it in case others had the same question:

 

I used .replace() to insert a bullet and tab after every <p> tag.

 

var s = Field("Special Interests").replace(/<p>/g,"<p>•<t>");

Link to comment
Share on other sites

×
×
  • Create New...