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?
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
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:
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?
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?
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.
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?
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.
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.
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.