You won't be able to get the size
directly in visualforce
pageemail template, iffor that you wantwill have to render some components
based onuse the size ofrepeat tag to get the OpportunityLineItems
,count and then you will have to declare acan build further logic based on that variable in controller and assign the size of OpportunityLineItems
using below code.
public Integer<apex:variable sizeOfOpportunityLineItemsvar="sizeOfOpportunityLineItem" value="{get;set;!0}"/>
and set this variable
sizeOfOpportunityLineItems =<apex:repeat value="{!relatedTo.OpportunityLineItems.size();}">
then you can use this variable in outputPanel to render components
<apex:outputPanelvariable rendered="var="sizeOfOpportunityLineItem" value="{!sizeOfOpportunityLineItemssizeOfOpportunityLineItem !=+ 01}">"/>
</apex:repeat>
Number of Opportunity Line Items : {!sizeOfOpportunityLineItem}