We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 53291
    • 1 Posts
    Hi,

    I need to hide part of the template when the query string (GET) variable is present. I've tried <?php if (isset($_GET['ok'])) { ?> OK <?php } ?>, tried google for "hide by get parameter modx", etc but nothing found. How to do that?

    Kind Regards,
    Alex
      • 42562
      • 1,145 Posts
      https://modx.com/extras/package/geturlparam

      //www.example.com?myString=awesome
      
      [[!getUrlParam:is=`awesome`:then=`
      <link rel="stylesheet" type="text/css" media="screen" href="[[++assets_url]]myString.css">
      <link rel="stylesheet" type="text/css" media="screen" href="[[++assets_url]]myString123.css">
      `?
      &name=`myString`
      ]]
      
        TinymceWrapper: Complete back/frontend content solution.
        Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
        5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
        • 4172
        • 5,888 Posts
        or fastfield-tags (included with pdoTools)

        load the chunk 'yourChunk' if the url-param ok = 1:

        [[[[!#get.ok:is=`1`:then=`$yourChunk`]]]]
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 37105
          • 194 Posts
          Quote from: Bruno17 at Mar 07, 2017, 01:37 AM
          or fastfield-tags (included with pdoTools)

          load the chunk 'yourChunk' if the url-param ok = 1:

          [[[[!#get.ok:is=`1`:then=`$yourChunk`]]]]

          Thanks Bruno,

          I am a fan of pdoTools and this one is new to me smiley Still learning!
            Codeplaza Webdesign: for professional websites at low cost