Jump to content

Bulleted List


kjacobson

Recommended Posts

I know there is probably a simple answer to this, since I can't find the answer anywhere.

 

How do I create a bulleted list with one variable. For instance, when a new paragraph is started a bullet is inserted?

 

 

  • This is the variable
  • The same variable, but different paragraph

Link to comment
Share on other sites

  • 2 weeks later...

I never had a field with multiple "paragraphs" of text before, but I'm thinking you could pass the paragraphs from the field into an array by separating data by the hard return. Then you could concatenate the values and insert line breaks and bullets at the same time like this:

//replace myField with correct field name in first line of code
//remember to check "Treat returned strings as tagged text"

var myArray = Field("myField").split("/n"); 
var myList = "";

for (x in myArray) {
   if (x == 0) {
       myList += "• " + myArray[x];
       } else {
       myList += "<br />• " + myArray[x];
       }
   }

return myList;

I'm not sure if the /n tag is inferred by the hard returns in your data or if you would need to do a find and replace in the data file to add the tag. In the latter case, you would need to remember to check the box for tagged text when assigning your input file.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...