Welcome Guest, Not a member yet? Register   Sign In
conditionnal template
#1

[eluser]CrazyCat[/eluser]
Hello there, and sorry if the question is already answered...

Is there any way to use the parser with conditions?
I mean having a simple 'if ... then ... else' like:
Code:
{block:if (a == b)}
...
{block:else}
...
{/block}
Thanks for your responses, regards.
#2

[eluser]vendiddy[/eluser]
Don't know if this is what you're looking for, but I think you can use php:

Code:
<?php if ($a == $b): ?>
...
<?php else: ?>
...
<?php endif; ?>
#3

[eluser]CrazyCat[/eluser]
In fact, I want to create templates without putting in any php line, so others personns can edit files as html (or tpl).
And I think I'll parse but not display, it may let me having some keywords as:
Code:
{block:if !empty}
   {item:if is_first}
   {item:elseif is_last}
   {item:else}
{/block}
#4

[eluser]Lima[/eluser]
Please try Smarty Template Parser.
You check it here
#5

[eluser]CrazyCat[/eluser]
Thanks a lot Lima.

Regards




Theme © iAndrew 2016 - Forum software by © MyBB