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

    I have a question on how you would manage following.

    Our website is about a shooting association. There is every year a king and others who won the competition. To list them I’m searching for the best way. Creating a ressource for each year is too much work. Maybe there is a way to manage them in a list or something else.

    The list must contain this data: name1, name2, name3, year, imagepath, additional info
    Further there must be 4 lists with the same stucture.

    Please tell me how you would do this.

    Thx
    Patrick
      • 3749
      • 24,544 Posts
      There are about 50 different ways to do this in MODX. wink

      The most efficient would be a custom DB table (but the most work to implement).

      The best alternative would be a Tpl chunk with placeholder tags for each name and a snippet to set the placeholders. The data could be stored in a CSV file, in the DB, in another chunk (in any format -- to be read by the snippet), or in a resource.

      You’d have a resource for each year, but that resource would only contain a snippet tag for the snippet with the year sent as a property. The year could be stored in one of the resource fields or in a TV on the page. Here’s how it would look with the year in a TV called "YearTV" (and the snippet named "Display"):

      [[!Display? &year=`[[*YearTV]]`]] 
        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
        • 16040
        • 23 Posts
        I tried the xdbedit custom table module... But I didn’t understand it...

        If you could explain me how i can use it it would be exactly what I need.
          • 3749
          • 24,544 Posts
          Sorry, I’ve never used xdbedit. Do you know how to add a custom table to the MODX db using PhpMyAdmin? If not, my other suggestion is probably a better way to go.
            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
            • 16040
            • 23 Posts
            I know how to create a custom db with phpmyadmin... that is not the problem. best way would be a component (???) to manage this custom db... like xdbedit (or is there anything else to do this?)
              • 22527
              • 6 Posts
              This directly relates to a question I also posted this week in this forum. Does anyone else have any ideas on this topic?

              In my case, I want my client to be able to edit the big list (with parameters for each row, just as in your case), too.

              I’ll let you know if I can figure out the xdbedit module. undecided
                • 16040
                • 23 Posts
                this would be really nice if it would be easier to manage the custom db table with xdbedit for example...