We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29597 ☆ A M B ☆
    • 350 Posts
    Hi all,

    I am working on my Flexibility template for MODX Revo based on Foundation from Zurb. http://flexibilitymodx.com/

    What I need is a option to have Flexibility update or not update the existing resources.
    Who can help me figure out what the best way to approach this is?

    1. Right now Flexibility has xPDOTransport::UPDATE_OBJECT] set to false and is not updating existing resources, but this will not allow it to create a new home page with the ID: 1 (because this will exist already on a fresh MODX installation).
      If I set the xPDOTransport::UPDATE_OBJECT to true, existing Flexibility users will have existing content overwritten when they update...
      Wat would be good is to add a option before installing that will set the: xPDOTransport::UPDATE_OBJECT => true, or to: xPDOTransport::UPDATE_OBJECT => false,
    2. A other option is to have my Flexibility package create a homepage with a number like 99 on install... and somehow remove the default Home (1) page on install
    3. What would be really great, if somehow the package would overwrite resources on new installs but would not on updates... I guess this is possible but how?


    See all the code on GitHub: https://github.com/DESIGNfromWITHIN/Flexibility [ed. note: ThaClown last edited this post 13 years, 9 months ago.]
      MODX Ambassador (NL) | Responsive web design specialist, developer & speaker
      DESIGNfromWITHIN, MPThemes and Any Screen Size
      Follow me on Twitter | Read my blog | My code on GitHub
      • 18373 ☆ A M B ☆
      • 3,141 Posts
      If you manually create the resource in the same fashion you are manually setting the system setting (in a resolver), you can do it. I don't think you'll be able to set the UPDATE_OBJECT flag "on the fly" as it's all packed into the zip before it even hits the target install.
        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.
        • 29597 ☆ A M B ☆
        • 350 Posts
        I could use some more in depth help on creating a resolver that will detect a user setting and then override resources or not...
          MODX Ambassador (NL) | Responsive web design specialist, developer & speaker
          DESIGNfromWITHIN, MPThemes and Any Screen Size
          Follow me on Twitter | Read my blog | My code on GitHub
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Isn't this what the installation options is for? For example, Quip has a popup form for getting email addresses before it installs itself.
            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
            • 10208 ☆ A M B ☆
            • 1,780 Posts
            Menno, you know I've been watching for this and thinking of solutions. Here's my latest greatest idea.

            What about packaging the upgrade separately? Give it a new template directory, which could include upgraded templates as well as new Foundation files.

            The problem with upgrading Flexibility is that those of us who use it, likely modify the templates and make new chunks/TV's anyway. Show us what is updated, and give us the option to change templates if we're going stock, or pull the chunks and TV's at will, if we're not.

            Flexibility is great as a base install but I'm not sure updating wouldn't break a lot of sites. In the one install I've got with Foundation 3, I can't minimize the js or update to 3.1 or 3.2 Foundation without breaking my menus, and I'm not sure I'd run an update even if it were available without modifying the resources.

            I ran update once just to see what would happen. It's pure chaos. Never do it.

            [ed. note: frogabog last edited this post 13 years, 9 months ago.]
              Frogabog- MODX Websites in Portland Oregon
              "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
              Having server issues? These guys have MODX Hosting perfected - SkyToaster
              • 10208 ☆ A M B ☆
              • 1,780 Posts
              I also do not think that package upgrades should be included in an update.

              Unless they pertain to a particular change in the template (Flexibility assumed as as a "template"). Assuming template changes correspond to TV and chunk changes.


                Frogabog- MODX Websites in Portland Oregon
                "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                Having server issues? These guys have MODX Hosting perfected - SkyToaster
                • 29597 ☆ A M B ☆
                • 350 Posts
                Thanks,

                I have to agree I think, maybe I should not provide a 'general' Flexibility update at all...
                There are two seperate 'update' issues:

                1. A general update of the core system: Foundation
                  This will indeed be a quite big update and not a good thing to provide for live sites at the click of a button.
                2. A small internal fix/update of the Flexibility template
                  Lets say I fix/update a chunk/snippet, I could provide a separate update package called "Flexibility update".
                  But how can I version this without me having to keep creating separate packages?

                Maybe I can 'force' users of Flexibility to change the name of any chunk, snippet or template variable they modify, tbhis way I can keep updating Flexibility chunks, snippets and template variables (maybe add a "fl_" before any item)

                This way, updating will be 'safe' and separate from the Foundation core.
                  MODX Ambassador (NL) | Responsive web design specialist, developer & speaker
                  DESIGNfromWITHIN, MPThemes and Any Screen Size
                  Follow me on Twitter | Read my blog | My code on GitHub
                  • 10208 ☆ A M B ☆
                  • 1,780 Posts
                  fl(version number)_


                  Could you use Bob's My Component to package the package?

                  It would be nice to see what's changed, and it would provide for additional designing if you wanted to venture that way.
                    Frogabog- MODX Websites in Portland Oregon
                    "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                    Having server issues? These guys have MODX Hosting perfected - SkyToaster