We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28120
    • 380 Posts
    I’m interested in a practical solution to managing preview/staging resources alongside live.

    Here’s a typical scenario. I’ve got a publicly quoted client and at results time they need to publish several pages of financially sensitive information.


    • It has to be accurate so a site preview must be checked by the accountants and lawyers as well as marketing
    • It’s time sensitive – must go out exactly on time and not be leaked out early

    Currently this client is running Evolution with a module http://modxcms.com/forums/index.php?topic=32336.0 that copies files and data from a staging site to the live site. This sort of works ok except


    • If another page, like a press release, needs publishing whilst the financial results pages are still a work in progress I have to temporarily un-publish the pages, copy staging to live and then re-publish (in staging)
    • If there was dynamic content, like comments, this scenario wouldn’t work

    I’m thinking that having a more sophisticated ‘published’ setting could work in the majority of cases, where there are 4 statuses rather than the current 2, such as

    1. not published at all
    2. published in preview mode only (excluded from search)
    3. published in live mode only
    4. published in live and preview mode (same as published currently)

    Plus a batch process at the end of a project to

    1. convert 2 > 4
    2. convert 3 > 1
    3. delete all 1’s

    Preview mode would only be visible on a separate url that could be protected in some way (password, ip address etc.)

    I know this isn’t the gold plated solution and doesn’t deal with snippet code versioning and so on but it would deal with the day to day issues of content publishing.

    Ok, shoot me down in flames …

    Mark
      • 18373 ☆ A M B ☆
      • 3,141 Posts
      I’m very interested in hearing what others think about a solution like this as well.. I see a couple of technical challanges with what you suggest (like where we’re saving the unpubbed version?) and also what is done with an staged revision of an already pubbed resource, how do we access that?
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 28120
        • 380 Posts
        Looks like it’s only me and you interested in this Mark
          • 33968
          • 863 Posts
          I imagine there are quite a few others who would be interested in this smiley

          News sites and intranets would really benefit from a ’staging’ facility within MODx as content usually needs to be approved and published by someone other than the author.

          Just getting some ideas out there:


          • What if the [tt]site_content[/tt] table was duplicated in a custom [tt]site_content_staged[/tt] table, allowing both staged and published versions of the same content simultaneously? The ’staging’ table would mirror the ’content’ tree structure, but it would be this table that users would edit before submitting changes or new content for approval.

          • The create resource, duplicate and edit resource actions could be overridden to apply to the [tt]site_content_staged[/tt] table rather than [tt]site_content[/tt]. [tt]site_content[/tt] would effectively be read-only.

          • There would be a publish function that would allow users with the right privileges to approve and publish staged content. When this function fires, the [tt]site_content[/tt] table would be updated with the staged content - either one resource at a time, or as a ’whole site’ batch update.
          • Not sure the best way to implement this in the manager UI - extend the document tree or resource editing page in some way to include a ’staging’ tab, or possibly use a Tree-structure CMP?

          Anyone have experience with publishing systems? How is this kind of thing usually handled, both in the DB structure and also within the manager layout?
            • 33968
            • 863 Posts
            Just occurred to me that a simpler way to do it might be to have a separate install to be used as the ’staging site’, with some kind of script to synch or ’publish’ selected resources to the live site database. More like a standard development/staging/production setup.
              • 4172
              • 5,888 Posts
              there was the contenthistory-plugin by Stefan for evolution.
              I’m not sure how it runs with the actual version of evo.

              You could switch between different revisions of resources and also a draft-mode was planned.
              I’m not sure if it was/is possible to switch to different protected previews from frontend, but should be doable.
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 28120
                • 380 Posts
                I’m already using this script for an Evolution site

                http://modxcms.com/forums/index.php?topic=32336.0

                but as I mentioned above the downsides to this approach are


                • It’s all or nothing - if another page, like a press release, needs publishing whilst the bulk of your edits on other pages are still a work in progress you have to temporarily un-publish the pages, copy staging to live and then re-publish (in staging)
                • If there is dynamic content, like comments, this scenario wouldn’t work because the dynamic content would NOT exist in the staging version which would over-write the live version on publishing
                  • 33968
                  • 863 Posts
                  Quote from: sparkyhd at Jun 30, 2011, 04:23 AM

                  If there is dynamic content, like comments, this scenario wouldn’t work because the dynamic content would NOT exist in the staging version which would over-write the live version on publishing

                  Going back to my second suggestion above, what if you had a separate ’staging site’ (maybe on a subdomain?) with the ability to publish individual resources to the live site (rather than a whole-site sync). Any dynamic content such as comments, etc would reside on the live server, while all edits and new content would be produced on the staging site then submitted for approval.
                    • 28121
                    • 107 Posts
                    Hi sparkyhd

                    Just wanted to ’plus 1’ your suggestion. I believe there are a lot of Modx folk who would put this as a priority for the next version of ModX.

                    In my own case, I recently lost out on a tender for a CMS and design for a site that would have kept us busy for 4 months. When I asked why we lost the pitch, the client said they were running with Drupal and another vendor because the CMS we use didn’t support both versioning and more staged publishing / review options.

                    That’s not ModX fault. It’s up to me to obviously dive into Drupal (shudder) and expand my offering but it’s a feature that I would dearly love to see very soon.

                    Can I also just pitch in and say that it’s important that it’s not too technical. I’m more a web designer with some ligh development skills and have zero experience with databases apart from installing Modx. if a staged workflow involved a lot of database fiddling, then I think I’d have to figure out another way round this.