We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 43177
    • 11 Posts
    Hey!

    I have a kind of smart problem but I have no idea how to solve it. At first an overview about my system and what I do.


    I have a database with a few datasets. Containing information about a special fire fighter units operation. I'am member of this unis ;-)
    Now I want to show a list of alarms to visitors of our website ordered by year.
    I have a ressource within two div-containers. One hold the content, the other a list of links (a href's). When I now call a link a signal or whatever shall passed to my snippet call with the SQL-Query expecting the year. [[operationOfYear? &year=[[currentYear]]]]
    Is it possible to exchange the [[currentYear]]-call so that another value is passed to the call?


    THANK YOU

    This question has been answered by Bruno17. See the first response.

    [ed. note: stahli last edited this post 13 years, 1 month ago.]
    • discuss.answer
      • 4172
      • 5,888 Posts
      In your link-list:

      <li><a href="[[~[[*id]]? &year=`2010`]]">2010</a></li>
      <li><a href="[[~[[*id]]? &year=`2011`]]">2011</a></li>
      <li><a href="[[~[[*id]]? &year=`2012`]]">2012</a></li>
      


      call your snippets uncached:

      [[!operationOfYear? &year=`[[!currentYear]]`]]


      your currentYear - snippet:

      return $modx->getOption('year',$_REQUEST,'');


      or put

      $year = $modx->getOption('year',$_REQUEST,'');


      directly into your operationOfYear - snippet.

      [ed. note: Bruno17 last edited this post 13 years, 1 month ago.]
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 43177
        • 11 Posts
        Awesome!

        That's exactly wat I need. And IT WORKS!


        Thank You