We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42461
    • 3 Posts
    Hi all!
    I have to do a website which displays 4-5 categories of products with a title, description, picture and price. (No cart or payment involved).
    There should be (admin) provision to add/edit these products in the backend.
    For each category there will be a list of articles and option to add them (in the backend)
    Please tell me how easy it is to do the above with modx and which modules I should use.

    Thanks a lot in advance for your kind help.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      I would suggest something like MIGXdb. This isn't really that much different from a gallery, so you would just create a resource for each category, and use the MIGXdb TV to handle the items in each category.

      If you only have a few items per category, a plain MIGx TV would work with very few modifications to the demo forms and grid, but if you'll have a lot of items a full custom database table would be the best way to go.

      http://rtfm.modx.com/display/ADDON/MIGXdb
      http://rtfm.modx.com/display/ADDON/MIGXdb.Create+a+basic+gallery-management+from+scratch+with+MIGXdb
        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
        • 42461
        • 3 Posts
        Thank you @sottwell for your quick reply.
        If you only have a few items per category..
        Most categories have around 10-15 items and very few have 25-30 items.
        I have just basic knowledge of PHP, so hope there wont be much custom coding involved.
        Also please tell me how easy it will be for a layman to add/edit products and articles.
        Thanks a lot again.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          No PHP involved at all.

          You can start with a MIGx TV, then if it seems to be slow, graduate to a custom table and MIGXdb (basically the same thing, but saves the item's data to a custom table).

          For your layman editor, you just go to the "category" resource in the Manager's left-hand tree, go to the Template Variables tab, and add/remove/edit items right there.

          To create the TV, use the basic MIGx instructions here, and just add another field for the price to the Form Tabs. The JSON structure may look a little intimidating at first, but all you need to do is add one line so that it looks like this
          [
          {"caption":"Info", "fields": [
              {"field":"title","caption":"Title"},
              {"field":"description","caption":"Description","inputTV":"richtextTV"},
              {"field":"price","caption":"Price"}
          ]},
          {"caption":"Image", "fields":[
              {"field":"image","caption":"Image","inputTV":"imageTV"}
          ]}
          ]


          This will cause your MIGx TV to open two tabs when you click "add new item", one with the caption "Info" and three fields, Title, Description, Price. The Description field will be a rich-text editor. The second tab will be for Image, and will have an image browser for uploading and selecting the image for this item. When you're done, the grid will show your item's title and a thumbnail of the image; that is controlled by the Grid Columns JSON.

          The two "inputTV"s are just ordinary TVs, one a rich-text type TV and the other an image-type TV. These are embedded into the MIGx TV to serve as input fields.

          To display your items on the web page, just use the getImageList snippet, as described in the frontend usage page. Adjust the tpl (chunk) so the items' data is formatted the way you want.

          Here are a few tutorials that may be helpful
          http://www.cmstricks.com/blog/2012/10/24/migx/
          https://www.markhamstra.com/modx-blog/2012/04/managing-galleries-with-migx/
          [ed. note: sottwell last edited this post 13 years, 9 months ago.]
            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
            • 42461
            • 3 Posts
            Thanks a lot @sottwell for your patient help. Really appreciate it.