This function can be used to check whether a template exists in the context of the current site or not. The function returns true
if the template is accessible in the template lookup path of the current site. Otherwise, the function returns false
. Use the expression inside ISML Tag - ISIFstructures.
existsTemplate(String)
<isif condition="#existsTemplate('inc/DBreadcrumbTrail')#">
The template name can also be build dynamically using ISML string concatenation:
<isif condition="#existsTemplate('product/ProducTabs_'.CurrentChannel:TypeCode)#">
Use the function to implement a fallback from a specialized template to generic template. For example, consider the product detail page of the Consumer Channel which has tabs that do not appear in other channels. Using the ISML Function - existsTemplate(), a generic product detail page can be constructed, including a fallback like:
<isif condition="#existsTemplate('product/ProducTabs_'.CurrentChannel:TypeCode)#"> <isinclude template="#'product/ProducTabs_'.CurrentChannel:TypeCode#"> <iselse> <isinclude template="product/ProducTabs"> </isif>