Jump to content

Bullet List


ksohayda

Recommended Posts

Hi,

 

I'm trying to set-up a variable postcard with bulleted copy.

The bullets need to disappear if no copy is present in the field.

However, my field has to have hard returns as well? Please see attached PDF for visual.

 

I created two seperate varaible text boxes. One for the bullet and one for the varaiable field? Not sure if this is the way I should go? Also, I can't get the bullet to disappear. Not good at writing Javascript code. Here's a code I've been working on?

 

if (Field("Treatment Center1") == "")

return "";

else

return '• '+Field("Treatment Center1");

 

if (Field("Treatment Center2") == "")

return "";

else

return '• '+Field("Treatment Center2");

if (Field("Treatment Center3") == "")

return "";

else

return '• '+Field("Treatment Center3");

if (Field("Treatment Center4") == "")

return "";

else

return '• '+Field("Treatment Center3");

 

 

Anyone out there that can help or give advice as to what to do?

PostcardExample.pdf

Link to comment
Share on other sites

  • 1 month later...

ksohayda,

Here is an easier way to accomplish your bullet list:

outstr = "";

 

for (item = 1; item < 9; item ++) //we are establishing the Loop where item loops thru each number less than 9

 

{

itemName = "Treatment Center" + FormatNumber("0", item); //our field is Treatment Center1-8 we are formatting it based on whatever item is

 

if (Len(Field(itemName)) > 0) //this is saying if the length is > 0 or could also be != ""

 

{

outstr += '<p>' +' • ' + Field(itemName);

}

}

outstr += "<p>";

 

return outstr;

Make sure that you have the "Treat return strings as tagged text" check box checked for the Rule.

 

Hope this helps

Link to comment
Share on other sites

You don't need a rule at all. You can do this in the Variable Text Editor: on each line, type the bullet character and insert the field name variable. Then do a "Select All" (Ctrl-A), click the "Paragraph" button, check the "Suppress if" box, and change the drop-down to "Containing Empty Variables."
Link to comment
Share on other sites

  • 3 months later...

Archived

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

×
×
  • Create New...