Site Search
sitemap • search tips • faqs 
Frequently Asked Question #53
How does the FusionBot template object's IF / ENDIF logic work?
For implementers of a Custom Template file, there may be times when you do not wish for certain HTML tags within your template to be printed, such as when the value of a specific template object tag is NULL, when the object text represents text, or 0, when the object tag represent a numeric value.

IF / ENDIF logic may be used for any valid template object tag. Also, for even greater control, you may nest IF / ENDIF blocks within one another. Following is the basic syntax of an IF / ENDIF block:


    <font face="arial">$LGK_OBJECT_NAME</font>


When the FusionBot template parser encounters the beginning of an IF block for a specific object, as denoted by the value of OBJECT_NAME, it will only print the contents between the IF and ENDIF syntax when the value of the specified OBJECT_NAME called within the block is NOT NULL.

When creating an IF / ENDIF block, the parser expects to find a corresponding template object tag within it. If the parser does not find the corresponding object tag within the block, the entire contents of the block will be ignored, regardless of the value of the corresponding object tag.

For example, in the following template code, if the value of the FusionBot template object $LGK_MATCHED is NULL, not only will no output be printed in place of the object tag, the HTML tags contained within the IF / ENDIF block will not be printed either. This prevents unnecessary HTML tags from being included in your output that may otherwise cause improper formatting of your results:


    <font face="arial">$LGK_MATCHED</font>


In this example, the $LGK_MATCHED object returns the text line describing the number of documents that the query performed has "matched", such as:

Matched 59 pages in 0.01 seconds

When no matching search terms exist for a keyword, the value of $LGK_MATCHED is NULL, which will cause the text and object tags within the IF block NOT to print.

You can further extend the functionality of the IF/ENDIF logic by including an ELSE clause as well. When using the ELSE clause, when the value of the corresponding template object tag is NULL or 0, the contents within the ELSE block will be printed, rather than the contents of the IF block:


    <font face="arial">$LGK_MATCHED</font>


    Your Search for: $LGK_KEYS, resulted in no results.


Again, the most important requirement to remember is that whenever using any IF logic within your template, the corresponding object tag which you are evaluating for MUST be present within the IF block of code, in order to function correctly.

More information on all available FusionBot Template Object Tags, and their use, please reference our Template Object Documentation PDF.

If you did not find an answer to your question, please return to the Support Page and fill out the form provided.

 Featured Customers:
  • Covenant Health Products
  • HMAC Systems
  • Recycle Away
  • American Electric Power
  • Everywherechair
  • Fleet Safety Equipment, Inc.
  • HandsOnTools
  • Marshas Clothing
  • MerckSerono
  • R-JetTek Inkjet Technology Solutions
  • Madison Gas and Electric
  • Phoenix Manufacturing
  • BMI Karts & Parts
  • Battery Clerk
  • Capital Tractor
  • Backyardpoolsuperstore
  • BBQ Island Outdoor Products
  • CBM
  • DCU - Digital Federal Credit Union
  • Coilcrat
  • LinesToGo

[Subscribe to FusionBot - Site Search & Sitemap Solutions]
Copyright 1998 - 2018 LOGIKA Corporation. All rights reserved.
[about site search] [advertising] [build vertical search engine] [reseller program] [popular searches] [terms of use] [uptime]