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

    I have recently undergone a project to update our company website which currently uses Modx.
    I have started work on a snippet which displays keywords from all of our blog posts, so far so good.

    What I need to know as I can’t quite figure a way as yet is if I can pass url variables and a second snippet then grabs those variables and displays the relevant data. I tried the @CODE and @EVAL option to allow me to use the $_GET function but to no avail.

    I am not exactly an expert in PHP either so I am just wondering if it’s possible before I hit my head on the table 1 last time.

    Thanks guys,

    I look forward to your reply smiley
    Jon
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      I believe that AjaxSearch can do this, keywords and all; check http://wiki.modxcms.com/index.php/AjaxSearch.

        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 14677
        • 54 Posts
        I just read up on this, and I am not sure I will be able to use this as it needs to return certain results based on an SQL query I have in place. It’s searching all blog post content relevant to a keyword passed across in a variable in the URL. This is what I need to do.

        Whether I can that is another matter smiley

        Thank you for the quick reply.

        Jon
          • 14677
          • 54 Posts
          Hi Susan,

          This is what I am trying to do and then grab that "pic" variable within a snippet?
          http://www.sottwell.com/gallery-demo.html?pic=12

          Is that using the AjaxSearch by any chance?
            • 14677
            • 54 Posts
            No problems guys, I have managed to solve this myself by assigning the url variable to a TV and calling the relevant TV information on the page that I am currently on.

            Thanks for your help Susan.