Salesforce 如何在电子邮件模板中使用条件语句?

Salesforce 如何在电子邮件模板中使用条件语句?,salesforce,Salesforce,我有一个问题与visualforce电子邮件模板有关,请帮助我解决。 我使用以下代码隐藏tr: <apex:repeat var="cx" value="{!relatedTo.Airline_Conf_s__r}"> <tr style="{!IF(!cx.Include_in_Confirmation__c == true,"display:none!important; ","")}"> <td> <apex:outputText value="

我有一个问题与visualforce电子邮件模板有关,请帮助我解决。 我使用以下代码隐藏tr:

<apex:repeat var="cx" value="{!relatedTo.Airline_Conf_s__r}">
 <tr style="{!IF(!cx.Include_in_Confirmation__c == true,"display:none!important; ","")}">
<td>
<apex:outputText value="{!cx.Airlines_Url__c}" escape="false" /> 
</td>
</tr>
</apex:repeat>

but i need it to done without inline style .how can it possible.

但是我需要它没有内联风格。怎么可能呢。
您可以尝试使用apex:outputtext的“rendered”属性,如下所示

<apex:outputText rendered = "{cx.Include_in_Confirmation__c}" value="{!cx.Airlines_Url__c}" escape="false" /> 

最好使用apex:outputPanel标记并使用渲染属性:

<apex:repeat var="cx" value="{!relatedTo.Airline_Conf_s__r}">
<apex:outputPanel layout="none" rendered="{!cx.Include_in_Confirmation__c == true}">
    <tr>
        <td>
            <apex:outputText value="{!cx.Airlines_Url__c}" escape="false" /> 
        </td>
    </tr>
</apex:outputPanel>

请注意,布局属性设置为“无”,这将有效地告诉VF不要呈现标记,但您将获得能够在中继器循环时动态呈现TR标记的好处