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

    Is it possible to create hyperlinks using @SELECT? I can’t figure it out.

    Regards,

    Tyronne
      • 3749
      • 24,544 Posts
      You need to tell us more about what you’re trying to do. @SELECT queries the database and there are no document-related URLs in the DB (unless you put them there via resource fields or template variables), so it’s hard to know how to answer your questions.

      Can you give a concrete example of what you want to do?
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 29540
        • 58 Posts
        Hi BobRay,

        I have a table with an "id" and a "name" column. I want to create a hyperlink where "name" is a link and "id" is a parameter to retrieve data from a second table.

        Regards,

        Tyronne
          • 3749
          • 24,544 Posts
          Is the table in the MODx database and is it a MODx table or a custom one you added?

          If it’s a MODx table, which one is it?

          Do the hyperlinks go to the MODx site or another site?


            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 29540
            • 58 Posts
            I added 2 custom tables, one with categories from which i want to creat hyperlinks that link to data from the second table. This data will be displayed on the same site.
              • 3749
              • 24,544 Posts
              @SELECT won’t help you with non-MODx tables. And, if you know a way of creating a hyperlink to data inside a MySQL database, you’re way ahead of me. wink

              I’m afraid I still don’t get what you’re trying to do. I’m probably being dense. Could you describe exactly what the site visitor sees and does before and after this operation?
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 29540
                • 58 Posts
                My 2 custom tables are inside the Modx database.

                Now i managed to create the hyperlinks using a snippet, im guessing thats the only way to achieve this. But now i need each link to open its own list of data. What i have done so far is create a link like this: http://......./?id=1 , because i need to pass the parameter to the next page to retrieve the correct data.

                Any tips?

                Regards,

                Tyronne