{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Conditionals","description":"Developer documentation for the WHMCS API — the","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"conditionals","__idx":0},"children":["Conditionals"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["It is often necessary to display text or messages when certain conditions are met."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["{if} statements in Smarty have much the same flexibility as PHP if statements."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Every {if} must be paired with a matching {/if}. {else} and {elseif} are also permitted."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["All PHP conditionals and functions are recognized, such as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["||"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["or"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["&&"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["and"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["is_array()"]},", etc."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"example","__idx":1},"children":["Example"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"{if $filename eq \"announcements.php\"}\n    This is the announcements page\n{else}\n    This is not the announcements page\n{/if}\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For more information, please refer to http://www.smarty.net/docs/en/language.function.if.tpl"]}]},"headings":[{"value":"Conditionals","id":"conditionals","depth":1},{"value":"Example","id":"example","depth":2}],"frontmatter":{"title":"Conditionals","seo":{"title":"Conditionals"}},"lastModified":"2026-08-03T17:00:42.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/themes/conditionals","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}