We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40088
    • 708 Posts
    I need the insight of experienced MODX users as to how to achieve the following.

    I have a client-specific area for contracts etc. Each client gets their own directory. When I add a new client I will simply duplicate an existing directory and change the relevant info.

    Client 1
    Client 2
    etc.

    Each client directory contains the same 3 file structure:

    Client 1
    > page 1
    > page 2
    > page 3

    While the content of each page in each directory will vary slightly all 3 pages share some common info within their respective directory, the client's contact info: name, email, phone, web address etc.

    Here's what I would like to happen: When I enter the contact info in Page 1 I would like Pages 2 and 3 to be auto-populated with the same info automatically but only for that specific client.

    Having just learned how to pull content from other pages in this thread http://forums.modx.com/thread/?thread=78093&page=3 I kind of have an idea of what needs to happen ... but there are some hurdles I can't suss out. I know I could manually add the same contact info for each page (it would be easy but repetitive) but I would prefer to automate as much of this as possible without having to edit/create new Snippets, TVs, or Templates each time I add a new client directory. Efficiency is key but I'm afraid I don't yet have the MODX understanding to know how to best pull this off.

    I hope that makes sense.

    Using Revo 2.2.4

    Thanks
      Todd
    • You should be able to automate that kind of information from the user database using a snippet. Base the query on the client's name, perhaps. (that's presuming that each client is a registered user)
        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
        • 40088
        • 708 Posts
        Quote from: sottwell at Jul 20, 2012, 08:34 PM
        You should be able to automate that kind of information from the user database using a snippet. Base the query on the client's name, perhaps. (that's presuming that each client is a registered user)

        The clients are not users or tied to MODX in any way.
          Todd
        • Ah, I see.

          Then perhaps you should look into MIGx. This is a multi-field TV, so you could have one TV to hold the client information. The output is managed by snippets, fetching the TV value (stored as a JSON array) and manipulating it as you please.

          A common scenario is to have a chunk mini-template with placeholders, and the snippet assigns each bit of data from the TV to placeholder, then parses the chunk tpl and replaces the placeholders. As Wayfinder, getResources, and most of the major snippets do.
            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