We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22629
    • 194 Posts
    I’m trying out MODx 2.0.0-rc2 and having a bit of difficulty getting the site_status working in a context - i.e. to turn a single site context off-line instead of the whole site.

    I’ve set up the context switcher plugin as described here and added a site_status Yes/No variable to the context I want to switch off-line with the value "No". The main site has the value "Yes."

    However both contexts/sites are still on-line.

    Is the value of this variable read before the OnHandleRequest event, that switches the context?
      Andy Shellam | www.networkmail.eu | @Pandy06269 @NetworkMail

      modx Revolution 2.2.6
      Windows 2012 | IIS 8 | php 5.4.11 | MySQL 5.5.29

      Content-Managed Websites Built on MODX
      • 3749
      • 24,544 Posts
      Create a context setting for that context with a key of site_status. That will override the system setting for that context.

      Go to System->Contexts. Right-click on the context and select "Update Context," then go to the context settings tab and click on "Create New."

      Key: site_status
      Value: 0
        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
        • 22629
        • 194 Posts
        Quote from: BobRay at Jun 07, 2010, 02:24 AM

        Create a context setting for that context with a key of site_status. That will override the system setting for that context.

        That’s what I have done; hence the reason for my question: huh

        I’ve set up the context switcher plugin as described here and added a site_status Yes/No variable to the context I want to switch off-line.

        Quote from: BobRay at Jun 07, 2010, 02:24 AM

        Key: site_status
        Value: 0

        Is that not what a Yes/No variable does when it’s set to No?
          Andy Shellam | www.networkmail.eu | @Pandy06269 @NetworkMail

          modx Revolution 2.2.6
          Windows 2012 | IIS 8 | php 5.4.11 | MySQL 5.5.29

          Content-Managed Websites Built on MODX
          • 3749
          • 24,544 Posts
          Sorry, I didn’t notice that you’d created a context setting. Did you clear the site cache, flush permissions and sessions, and clear the browser’s cache/cookies before testing?

          Do the site and the context have appropriate settings for site_unavailable_page and site_unavailable_message?

          What happens if you disable the plugin and set the context setting manually? Does that work to make the site offline in the context?
            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
            • 22629
            • 194 Posts
            Thanks, I’ve just tried all your suggestions but to no avail - the context still remains on-line.

            My context settings are as follows:

            site_start = 2
            site_status = No
            site_unavailable_message = The site is currently unavailable
            site_unavailable_page = 3

            My site settings are as follows:

            site_start = 1
            site_status = Yes
            site_unavailable_message = The site is currently unavailable
            site_unavailable_page = 0

            The context settings are recognised correctly, because the page displayed for the context is page ID 2.

            I’ve also changed the $modx->initialize call to initialise my context instead of ’web’ but it’s still classing the context as online.
              Andy Shellam | www.networkmail.eu | @Pandy06269 @NetworkMail

              modx Revolution 2.2.6
              Windows 2012 | IIS 8 | php 5.4.11 | MySQL 5.5.29

              Content-Managed Websites Built on MODX
              • 3749
              • 24,544 Posts
              Assuming that you haven’t created any site_status user settings or modified the site_status value in your code, it sure sounds like a bug to me.

              Could you file it in the Jira Bugs and Requests link at the top of this page?
                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
                • 22629
                • 194 Posts
                Will do, cheers BobRay.

                Has anything happened to JIRA? Do unused accounts get deleted or something? My username was "pandy06269" (confirmed because I can see issues I reported under that user ID) but when I try and request a password it says that username doesn’t exist - so I’ve had to re-register.
                  Andy Shellam | www.networkmail.eu | @Pandy06269 @NetworkMail

                  modx Revolution 2.2.6
                  Windows 2012 | IIS 8 | php 5.4.11 | MySQL 5.5.29

                  Content-Managed Websites Built on MODX
                  • 3749
                  • 24,544 Posts
                  Quote from: Pandy06269 at Jun 10, 2010, 03:39 PM

                  Will do, cheers BobRay.

                  Has anything happened to JIRA? Do unused accounts get deleted or something? My username was "pandy06269" (confirmed because I can see issues I reported under that user ID) but when I try and request a password it says that username doesn’t exist - so I’ve had to re-register.

                  I don’t know about that. It’s still working for me.

                    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
                    • 22303 MODX Staff
                    • 10,725 Posts
                    Quote from: Pandy06269 at Jun 10, 2010, 03:39 PM

                    Will do, cheers BobRay.

                    Has anything happened to JIRA? Do unused accounts get deleted or something? My username was "pandy06269" (confirmed because I can see issues I reported under that user ID) but when I try and request a password it says that username doesn’t exist - so I’ve had to re-register.
                    Hmm, we did have a large influx of spam registrations which we removed with an automated script we developed. It’s possible it could have gone awry and removed your account. If so, our apologies, but otherwise, I don’t see any other reason why your username would not exist.
                      • 36930
                      • 22 Posts
                      This thread is a tad old, but I just ran into this issue and don't see a solution here

                      The site_status context setting would only work form me if when creating the context setting, I set the Field type for site_staus as Yes/No.

                      When I left it as a text field, manually entering Yes or No, or 0/1 would not affect the Site Staus.