hi!
I want to do a simple thing:
on the start page index.php i have 2 links generated by me:
index.php?beratung=on
index.php?beratung=off
I made a snippet called "menu" with the following content:
<?php
echo $_GET["beratung"];
?>
In my standard template I included the snipped:
[[menu]]
Then I started the page in the browser. I didn’t klick on any link and there is already an output: "on"
when i click on the other link, the output also doenst change to off.
any ideas?
thx, greetings, bernd
MODx uses index.php to route all requests for pages on the site so you generally don’t want to be messing with the index.php URL.
You could set a $_SESSION variable instead.
Maybe if you told us more about what you’re trying to do and why we could suggest other alternatives. Have you looked at the Wayfinder snippet for creating your menu?
You could also try changing the links to
[~[*id*]~]?beratung=on
[~[*id*]~]?beratung=off
then it should pass the parameter to the current page.