We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24208
    • 17 Posts
    helo again. my issue came up when I tried to call a content (document) with the extra parameter (as index.php?id=48&param=xyz). this param would be used as parameter for a ditto call to show document(another as called - param is not equal id) in different view as using as with associated template in the called document.

    i simply dont know how to get variables through url metod. saw it somewhere for sure, but cant find it again.

    thanx for an answer wink
      • 7231
      • 4,205 Posts
      In a snippet use the $_GET like in a ’normal’ php script.

      In Ditto you can use the request extender.

      Here is an example that I used on my site to get the Tag to be used as a title:

      <?php
      // diplay tags request
      if(isset($_GET['tags'])) {
          $title = $modx->documentObject['pagetitle'];
          return $title.": ".htmlspecialchars($_GET['tags'])." ([+total+])";
      } else {
          $title = $modx->documentObject['longtitle'];
          $introtext = $modx->documentObject['description'];
          return $title.$introtext;
      }
      ?>
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don&#39;t know what it is.
        Do you, Mr. Jones? - [bob dylan]