We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8168
    • 1,118 Posts
    OK thanks anyway. I take it to get a new version of a MODx installation going again you can just import the SQL database? (for example if i was backing up my site and it went down, but i had a recent backup - i could easily install MODx again and import the SQL database?


    Cheers
    • bkupMODx zips up the whole thing, files and all. In the backup/archives folder you’ll find the zipped archive (or if you’re using the module it’s in the Archives menu). When you unzip the archive, it will include the backup/archive folder which got backed up along with the MODx files. It will not contain any old zip files, but it will contain the .sql dump file. It backs up all the modx files and itself, but not the old zip files so that the archive doesn’t keep getting bigger and bigger if you leave the old zip files there.
        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
      • To answer your specific question, however, yes, you can do it that way. You’ll likely need to run the installer again in upgrade mode after importing the old database, however, in case there were any changes to the database that your import rolled back.
          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
          • 8168
          • 1,118 Posts
          Great Thanks - I have gone with Modbak at the moment as it seems so simple!
            • 8168
            • 1,118 Posts
            Susan,

            Quick question re: your TemplateSwitcher snippet...

            It says in the documentation here that you can pass a template name to a page via a URL string??

            // TemplateSwitcher - plugin for MODx
            // [email protected]
            // released to the Public Domain
            // uses OnLoadWebDocument event
            // stores template choice in cookie
            // add the usecookie argument to the Configuration
            // &usecookie=Use Cookie;list;no,yes;no
            // default is ’no’
            // set Configuration to ’yes’ to use cookie
            // place an HTML comment <!-- donotswitch --> in the content of pages you don’t want switched
            // add template=templatename to the URL


            I am using templateswitcher with a mobile detection script, but want to be able to have an opt out if a user is shown the mobile version of a page while they feel they should not, i.e. give them a link to view the same page with a different template creating the page. Is this possible?

            For example home.html?template=homepage huh


            Many thanks!
            • That is correct. Be aware that the page cannot be cached; if it’s cached MODx doesn’t even look for a template.
                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
                • 8168
                • 1,118 Posts
                :(

                Tis not working... The page is uncached (as it needs to be for the mobile redirect also....)


                I have a text link with this code applied to it to try and load the same page with the alternate template a href="home.html?template=homepage"

                ’homepage’ is the name of the template i want the home.html document to be re-rendered in when the link is clicked...


                Am i missing something?


                Many thanks ;]
                • I honestly don’t know. I wrote that years ago for a specific purpose, where it did what was wanted. Since then, it’s been proven to be erratic under different circumstances, and has been known to cause problems on some sites. I would have to install it and see what it’s doing; it may not even work at all now. What version of MODx are you using it on?
                    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
                    • 8168
                    • 1,118 Posts
                    Running 0.9.6.3

                    Actually using this snippet to do switch of templates based on user browser type - http://modxcms.com/extras/package/557



                    Thanks