We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51382
    • 53 Posts
    Background:

    I have a small event listing website and currently it's a two-step process to post 1 event. First I need to create the event page (10 tvs) and then I create the event listing which via getPage displays on the homepage. This second resources uses 4 of the same tvs that the event page uses.

    What I'd like to do:

    Is there a straightforward way to automatically generate the second resource from tvs in the first one and then have it publish onto the homepage at the time I publish the first event page?



    I've been using MODX for 3-4 months and am only versed in html, bootstrap and css, (i.e. no java or php) so may need to ask a follow up question if this is in fact possible.

    This question has been answered by sottwell. See the first response.

      • 3749
      • 24,544 Posts
      The only way I can think of to do it would be in PHP code, with a plugin attached to OnDocFormSave.

      You'd also need code attached to OnDocPublished to publish it at the same time as the other page.

      It would be kind of tricky, even if you did know PHP.
        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
        • 3749
        • 24,544 Posts
        BTW, I'm wondering if you actually need a second resource. It sounds like the information you need to pull into the home page is already in the TVs of the first resource. Maybe a custom snippet could pull that information from the most recently published resource (or the most recently published resource in a certain folder).
          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
        • discuss.answer
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Indeed. pdoResources can fetch any fields you want from any resources using queries to filter.
            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
            • 51382
            • 53 Posts
            Thank you for the responses. I will investigate pdoResources.