| 198 | |
| 199 | === if_exists( template_name:string ) : string | undef === |
| 200 | |
| 201 | This function checks if the template named {{{template}}} exists on the current load path. |
| 202 | If it does, the function returns the template name; if not, it returns {{{undef}}}. |
| 203 | |
| 204 | This can be used to conditionally include a template only if it exists: |
| 205 | {{{ |
| 206 | include {if_exists('my/conditional/template')}; |
| 207 | }}} |
| 208 | This function should be used with caution as this brings in dependencies based on the state |
| 209 | of the file system and may cause dependency checking to be inaccurate. |