We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8895
    • 76 Posts
    hi every1 !!!

    ill keep it short and simple:
    ive got a list of media, sorted by a specific tag (lets say: fun).

    when i select something from this list, it sends me to an other page
    where a snippet is called up to display the media.

    thing is, the snippet needs a variable to be set with the name of the
    media that should be displayed.

    question:
    how can i send the name (variable) of the media file, from the list
    to the other page, to then implement in the snippet call.


    and here is something similar to the top part:-
    when i select a tag (im making a custom tag’s snippet, as the otherone does not meet my requirements),
    the snippet that is called uppon that needs to know which tag was selected.
    how can i do this?


    thank you in advanced!
      • 22303 MODX Staff
      • 10,725 Posts
      Add them to the query string of the links (or as form elements for a submit action), and use PHP $_GET or $_POST to retrieve query string parameters from the request, just as you would with any PHP code.
        • 8895
        • 76 Posts

        so what u mean is:
        <a href='xy.php?variable=fun'> Link </a>
        


        my big question mark is, which url do i call?
        or do i just do self, as in:
        <a href='?variable=fun'> Link </a>
        


        my doubt here is, that its not the same page,
        theres 1 page that displays the list of media
        and the next page then shows the media...
          • 22303 MODX Staff
          • 10,725 Posts
          Quote from: enigma at Dec 12, 2006, 10:18 AM

          my big question mark is, which url do i call?
          or do i just do self, as in:
          <a href='?variable=fun'> Link </a>
          


          my doubt here is, that its not the same page,
          theres 1 page that displays the list of media
          and the next page then shows the media...
          You use the MODx link tags...

          For instance, to create a link to the current page...
          <a href="[~[*id*]~]&variable=fun"> Link </a>
          

          or, for a specific page with ID = 15...
          <a href="[~15~]&variable=fun"> Link </a>
          

          NOTE: I always use & after those generated links because that always works with FURLs (Friendly URLs) on or not, since there is always a ? in the actual URL (even though you won’t see it in the rewritten URLs when using FURLs).
            • 8895
            • 76 Posts
            ok makes sence.

            so now i call a page like that, then on that page i have a snippet call
            and then i do a GET iside the snippet?
              • 8895
              • 76 Posts
              and when i want to send a variable through the snippet call - like type=fish
              which is the easiest way to do this?
              sorta wont work with GET