0

I'm working on some email that will be deployed via Exact Target. We have a lot of AMPScript dictating what is going on within the email(s). The content blocks of the email are dynamically filled, and when a field is left empty there is still a call made to that table section, which then inserts a blank space on the email. Thus throwing the design out of whack. My question is, is there anyway I can have those empty cells completely removed from the page when not in use?

here is the code sample ...

Set @SendLog_blockC1 = lookup("RaceDataSendLog","BLK_C1","SubID",@SubLookup,"JobID",@JobLookup,"BatchID",@BatchLookup)
...
...
...
Set @blockC1 = Concat("My Contents\Newsletter\",@SendLog_blockC1)
....
....
....
....
%%[IF empty(@blockC1) THEN]%%

%%[ELSE]%%
<tr>
<td align="left" valign="top" >

%%=ContentAreaByName(@blockC1,"",0)=%%

</td>
</tr>
%%[ENDIF]%%

Thank you in advance.

Frankie
  • 1
  • 4

2 Answers2

0

On the assumption you're referring to that space above your ELSE - this should work:

<!--%%[
IF empty(@blockC1) THEN
ELSE]%%-->
<tr>
<td align="left" valign="top" >
%%=ContentAreaByName(@blockC1,"",0)=%%
</td>
</tr>
<!--%%[ENDIF]%%-->

This will hide the AMPscript in the HTML, in addition - you don't really need the IF to produce the space, you can just have the ELSE right after it.

edu8rdo
  • 216
  • 1
  • 8
  • I'd recommend not using HTML comments to hide the AMPScript. It will jack up the text version of your email. I have an alternative on my blog: http://sprignaturemoves.com/prettying-up-ampscript-in-emails/ – Adam Spriggs Oct 17 '14 at 01:18
  • You can also use the NOT operator before the empty() function -- e.g: IF NOT EMPTY(expression1) THEN. More info on that here: http://help.exacttarget.com/en-US/documentation/exacttarget/content/ampscript/ampscript_syntax_guide/ – Adam Spriggs Oct 17 '14 at 01:20
0

and thank you for your responses. I was finally able to resolve the issue of the extra spacing.

What I did was remove the <tr> and <td> tags from around the if/else statements. I then placed those <tr> and <td> tags around the content blocks that are brought in by the PM's when they decide which blocks to use. This solved the problem of the extra spacing. Client is happy!!!

Thanks again guys!!!

Frankie
  • 1
  • 4