简体   繁体   English

AMPScript:尝试插入隐藏字段

[英]AMPScript: trying to insert hidden fields

I'm working on some email that will be deployed via Exact Target. 我正在处理一些将通过Exact Target部署的电子邮件。 We have a lot of AMPScript dictating what is going on within the email(s). 我们有许多AMPScript指示电子邮件中正在发生的事情。 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. 先感谢您。

On the assumption you're referring to that space above your ELSE - this should work: 假设您指的是ELSE上方的空间-这应该起作用:

<!--%%[
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. 此外,这将在HTML中隐藏AMP脚本-您实际上并不需要IF来产生空格,只需在其后紧跟ELSE。

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. 我所做的是从if / else语句周围删除了<tr> and <td>标记。 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. 然后,我将这些<tr> and <td>标记放在由PM决定要使用的块时带入的内容块周围。 This solved the problem of the extra spacing. 这就解决了额外间隔的问题。 Client is happy!!! 客户很开心!!!

Thanks again guys!!! 再次感谢你们!!!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM