Hi guys,
I am currently building a new site with modX.
Before, I’ve been using the site without modX and it worked quite well.
I’m using a Javascript menu (fold-out.
http://www.foerderverein-drucktechnik-duesseldorf.de"" target="_blank" rel="nofollow">You can see it in action here.)
There’s also a PHP-call to determine which category is open and then it can stay open after reloading the site.
I know that I can’t execute PHP in the templates, so I created 2 snippets.
Snippet 1:
<?php
$x = "show";
switch($_GET['menue'])
{
case 1: $menue1 = $x; break;
case 2: $menue2 = $x; break;
case 3: $menue3 = $x; break;
case 4: $menue4 = $x; break;
case 5: $menue5 = $x; break;
}
?>
Snippet 2:
<?php
PHP echo $menue2;
?>
Code of the menu:
<div class="nav_wrapper">
<ul id="menu">
<li class="show" onclick="mShow(this);">Verein
[!Wayfinder? &startId=`2` &level='0'!]
</li>
<li class="[!menue2!]" onclick="mShow(this);">Gautschen
[!Wayfinder? &startId=`5` &level='0'!]
</li>
</div>
I’m calling the first snippet in the <head> area.
Problem is, that it doesn’t work. The variable doesn’t get echoed.