how do I use else_if function [solved]
Posted: Tue Jan 05, 2010 8:51 am
I am trying to get this to work http://wiki.cmsmadesimple.org/index.php ... re#else_if
I suppose I use this as a User Defined Tag; but when I try it says
Invalid code entered.
Parse error: syntax error, unexpected ';' in /home/content/w/e/b/webdesign678/html/northshoredrama.com.au/admin/adduserplugin.php(100) : eval()'d code on line 2
I pasted this in to a GCB
Then added {global_content name='elseif'} to the template
But when I go to index.php?page=pagename that did not work.
I have no idea; but maybe I have to add something to "$thispage = ;" ?
Any example of how I use this would be kindly appreciated
I suppose I use this as a User Defined Tag; but when I try it says
Invalid code entered.
Parse error: syntax error, unexpected ';' in /home/content/w/e/b/webdesign678/html/northshoredrama.com.au/admin/adduserplugin.php(100) : eval()'d code on line 2
I pasted this in to a GCB
Code: Select all
global $gCms;
$thispage = ;
$thispage = $gCms->variables['page_name'];
if ($thispage == "pagename") echo "this is for pagename";
elseif ($thispage == "othername") echo "this is for othername";
elseif ($thispage == "npage") echo "you can have as many elseif clauses you want";
else echo "default text";
But when I go to index.php?page=pagename that did not work.
I have no idea; but maybe I have to add something to "$thispage = ;" ?
Any example of how I use this would be kindly appreciated