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

    I need to convert a site that I have hand coded in PHP/MYSql/JavaScript into Modx, so I am a complete newbie

    My current site offers products in the following layout

    -top level category page, listing all categories
    --listing of products in category
    ---detailed listing of individual product

    The new Modx site must have the following layout (addition of a subcategory page)

    -top level category page, listing all categories
    --listing of subcategories within category
    ---listing of products in each subcategory
    ----detailed listing of individual product

    I have installed Modx and looked through the forums and think that I grasp the basics, but I would like some feedback on my modx design...

    I will create a template for top-category, subcategory, subcategory product listing, and product detail pages

    Questions...

    1) Some products can appear in multiple subcategories, and some subcategories can appear in multiple categories, how can I achieve this with Modx?

    2) I have some confusion around using chunks/snippets... Say I create a product template that includes a snippet called [[product_pdfs]]... Each time that template is used to create a new product; this will include the [[product_pdfs]] line of code in each product page. Say I no longer want to print out pdfs on the product pages, would I need to go into all of my product pages (potentially 100s!) and remove the snippet code?

    Also what if I add 100 products, then realise i have missed an attribute or snippet from the template, and need a paticular change to reflect across my product range, how can i do this without 100 edits?

    Or is there a better way to implement such functionality?

    Any answers to my questions or suggestions for my strategy would be much appreciated.

    Modx looks great; I am excited about getting stuck in

    Many thanks
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      1. Use Ditto to list your products using the structure of the Document Tree for some of the category structure, and Template Variables for category tagging.

      2. There are so many ways that could be arranged... you could use Template Variables for it, and simply remove the TV from its assignment to the template if you didn’t want it any more. Or you could have the snippet in the template instead of the content. Or you could have a chunk with the snippet tags, and just empty the chunk if you don’t want the snippet any more; an empty chunk won’t display anything. Or you could edit the snippet and just have it have one line, return; to do nothing. This is MODx! I’m sure plenty of people can come up with several other ways to deal with this.

      You really should try to structure your content in such a way as to minimize MODx tags in the content itself; try to use the template or TVs as much as possible to make it easier to make changes across the whole site or across groups of resources. But yes, there are times when you simply have to take the time to go through and edit your resources one by one.
        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
        • 14605
        • 40 Posts
        Just a quick update to say that MODx is superb!!

        I’ve setup the framework for my web site in about 2 hours, Ditto commbined with the document tree has made this an absolute breeze!! So powerful and so simple!

        one more question... If I have a resoure that I want to appear in more than one place in the document tree (i.e a product that sits in more than one category) how can I achieve this without the need to duplicate content? Bearing in mind i have not used TVs to tag the categories... I have simply used Ditto to list all items that are children of the current document.

        Many thanks
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          check the Ditto params; I believe you can specify individual resources with the &documents parameter.
            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
            • 27347
            • 65 Posts
            Quote from: jon.london at Jul 06, 2010, 05:42 PM

            Just a quick update to say that MODx is superb!!

            .............. ...............

            one more question... If I have a resoure that I want to appear in more than one place in the document tree (i.e a product that sits in more than one category) how can I achieve this without the need to duplicate content? Bearing in mind i have not used TVs to tag the categories... I have simply used Ditto to list all items that are children of the current document.

            Many thanks

            Using Revo i guess you could use the Symlink Resource type for documents that belong in more than one place in the doctree.
            Still new to Revo myself so i’m not sure if it is a good solution, but it’s worth checking out:
            http://svn.modxcms.com/docs/display/revolution/Using+Resource+Symlinks