N00b question, can't use if statement in User defined tag?
Posted: Fri Jun 05, 2009 11:56 am
My host is using CMSMS 1.5 (puerto rico)
I have a site which features different top level sections of the site, each of which has their it's own subnav. I figured to make it easy I'd create a UDT with a case statement.
I couldn't figure how, so I tried the examples from some Smarty posts and nothing.
So since I only have 4 different sections I decided to try an if / else statement, and it keeps throwing an error. The following code:
Produces the following error:
* Invalid code entered.
* Parse error: syntax error, unexpected T_VARIABLE, expecting '(' in /public_html/site/admin/edituserplugin.php(103) : eval()'d code on line 3
Can someone tell me what I might be doing wrong? I've even tried the most basic if statement and got an error:
{if 1 eq 1}
echo 'howdy';
{/if}
produces:
* Invalid code entered.
* Parse error: syntax error, unexpected T_LNUMBER, expecting '(' in /public_html/site/admin/edituserplugin.php(103) : eval()'d code on line 1
But none of the errors tell me WHAT code is invalid.
Can someone help me out please? I'd rather have a case statement, but I don't know if this host has the proper modules?
I have a site which features different top level sections of the site, each of which has their it's own subnav. I figured to make it easy I'd create a UDT with a case statement.
I couldn't figure how, so I tried the examples from some Smarty posts and nothing.
So since I only have 4 different sections I decided to try an if / else statement, and it keeps throwing an error. The following code:
Code: Select all
echo '<div id="subnavigation"><ul>';
{if $params['section'] eq 'aboutus'}
echo '<li><a href="our-team.php">our team</a></li>';
echo '<li><a href="affiliation-listing.php">affiliations</a></li>';
echo '<li><a href="location-directions.php">location and directions</a></li>';
echo '<li><a href="dealer-connection.php">dealer connection</a></li>';
{elseif $params['section'] eq 'products'}
echo '<li><a href="commercial-product-lines.php">commercial product lines</a></li>';
echo '<li><a href="residential-product-lines.php">residential product lines</a></li>';
{elseif $params['section'] eq 'dealerprograms'}
echo '<li><a href="monthly-specials.php">monthly specials </a></li>';
echo '<li><a href="training-classes.php">training classes</a></li>';
echo '<li><a href="incentive-trips.php">incentive trips</a></li>';
echo '<li><a href="forms.php">forms</a></li>';
{else}
{/if}
echo '</ul></div>';
* Invalid code entered.
* Parse error: syntax error, unexpected T_VARIABLE, expecting '(' in /public_html/site/admin/edituserplugin.php(103) : eval()'d code on line 3
Can someone tell me what I might be doing wrong? I've even tried the most basic if statement and got an error:
{if 1 eq 1}
echo 'howdy';
{/if}
produces:
* Invalid code entered.
* Parse error: syntax error, unexpected T_LNUMBER, expecting '(' in /public_html/site/admin/edituserplugin.php(103) : eval()'d code on line 1
But none of the errors tell me WHAT code is invalid.
Can someone help me out please? I'd rather have a case statement, but I don't know if this host has the proper modules?