Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2016-10-14 14:39:42

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: smd_at_work: click to put your site in maintenance mode

Bloke wrote #302168:

How did you get the plugin to throw a 301? It’s supposed to only throw 503s. The only way to throw custom responses is to intercept the txp_die callback at the moment.

That said, if I exposed a pref that allows you to specify which status code to throw — default 503 — I could repurpose the message field to be a destination URL (or add a new pref or something). The destination URL pref would only work with statuses (status? stati?) 301, 302, 303, 307 though. That any use to ya?

Sorry, you are correct sir. standard operation with a 503 page… would not pick up urlvars. you can forget all that other faff if you like.

Offline

#14 2017-03-27 22:40:48

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,445
Website GitHub

Re: smd_at_work: click to put your site in maintenance mode

Version 0.22 released that fixes the location of the admin-side maintenance message so it doesn’t clash so badly with other furniture in themes.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#15 2018-03-23 12:01:11

Kjeld
Member
From: Tokyo, Japan
Registered: 2005-02-05
Posts: 453
Website

Re: smd_at_work: click to put your site in maintenance mode

Hi Bloke, just tried this plugin with txp v4.7.0-dev.

It works, but when it is turned on, the publisher also gets the error message and can’t see the public site anymore…

That is true for Ruud’s rvm_maintenance as well.

Last edited by Kjeld (2018-03-26 22:31:40)


Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
JapaneseStreets.com – Japanese street fashion (mostly txp)

Offline

#16 2018-03-27 10:21:59

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,445
Website GitHub

Re: smd_at_work: click to put your site in maintenance mode

Kjeld wrote #310265:

when it is turned on, the publisher also gets the error message and can’t see the public site anymore… That is true for Ruud’s rvm_maintenance as well.

That is very strange. There should be no changes in core that stop either plugin working. That said, I have updated it for 4.7.0 but the changes are all internal:

  • Better class-based admin code.
  • Leave Textpack management to core.
  • Changed conditional tag to remove EvalElse().

Functionality-wise there should be no changes. So the issue you’re having with the plugins and 4.7.0 may stem from something else. The only situation you’ll see the maintenance mode message if you’re a publisher is if Txp thinks you’re “not logged in”.

Have you tried clearing your site cookies? Sometimes if they get messed up (odd domains or prefixes) then you get strange behaviour. I had that recently, where I could browse the admin-side fine but if I went to a new browser tab and typed in the domain, it’d log me out. Turned out to be a stale cookie with a double-slash in its path. Who’d have guessed.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#17 2018-03-27 11:37:24

Kjeld
Member
From: Tokyo, Japan
Registered: 2005-02-05
Posts: 453
Website

Re: smd_at_work: click to put your site in maintenance mode

Bloke wrote #310396:

That is very strange. There should be no changes in core that stop either plugin working.

Have you tried clearing your site cookies? Sometimes if they get messed up (odd domains or prefixes) then you get strange behaviour. I had that recently, where I could browse the admin-side fine but if I went to a new browser tab and typed in the domain, it’d log me out. Turned out to be a stale cookie with a double-slash in its path. Who’d have guessed.

Thanks, Bloke! I have tried clearing both the cache and the cookies, and I installed your new version. No luck so far. It still locks me out on the public side when maintenance is turned on.


Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
JapaneseStreets.com – Japanese street fashion (mostly txp)

Offline

#18 2018-03-27 11:43:41

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,445
Website GitHub

Re: smd_at_work: click to put your site in maintenance mode

Strange. Works fine for me.

Do the public tags work? Look at the example in the plugin docs and see if the conditional tag works.

Also, try this in any Page template:

<txp:if_logged_in>
Textpattern thinks I'm logged in.
<txp:else />
Textpattern thinks I'm logged out.
</txp:if_logged_in>

Then visit a page on your site (with maintenance mode off of course!) that uses that Page. What do you see? Does anything change if you log out of the admin side?


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#19 2018-03-27 11:51:02

Kjeld
Member
From: Tokyo, Japan
Registered: 2005-02-05
Posts: 453
Website

Re: smd_at_work: click to put your site in maintenance mode

Bloke wrote #310398:

Strange. Works fine for me.

Do the public tags work? Look at the example in the plugin docs and see if the conditional tag works.

Also, try this in any Page template:

<txp:if_logged_in>...

Then visit a page on your site (with maintenance mode off of course!) that uses that Page. What do you see? Does anything change if you log out of the admin side?

Oh, interesting. I get Textpattern thinks I'm logged out.. I’ll have a good look at some things, and see if I can find the cause for this.


Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
JapaneseStreets.com – Japanese street fashion (mostly txp)

Offline

#20 2018-03-27 11:59:03

Kjeld
Member
From: Tokyo, Japan
Registered: 2005-02-05
Posts: 453
Website

Re: smd_at_work: click to put your site in maintenance mode

Figured it out, Bloke!

There were two cookies, one with www. before the [site_name] and one without. It recognized only one of them. When I logged in with www.[site_name], txp knew I was logged in, when I logged in with [site_name] (without www.), it didn’t…


Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
JapaneseStreets.com – Japanese street fashion (mostly txp)

Offline

#21 2018-04-02 14:12:06

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: smd_at_work: click to put your site in maintenance mode

Stef,

I’m using. I need to be able to see what the maintenance mode looks like so I can fix it up proper visually. How can I be logged in and working but still be able to see the front-side in MM?

If I try and go to a different browser where I’m not logged in, I still see the site as if I’m logged in.

What’s the trick?

Offline

#22 2018-04-02 15:37:43

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,445
Website GitHub

Re: smd_at_work: click to put your site in maintenance mode

There’s no trick with this one.

  • Install and activate the plugin.
  • Go to the Prefs -> Maintenance mode.
  • Toggle maintenance mode on and set a suitable message. Or, if you prefer, create an error_503 Page template and that’ll be served instead.

When it’s active you’ll see a notification all the time in the admin side (bottom left of each page). Visit any other non-logged-in browser and you’ll see the maintenance message.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#23 2018-04-02 21:17:02

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: smd_at_work: click to put your site in maintenance mode

Destry wrote #310570:

If I try and go to a different browser where I’m not logged in, I still see the site as if I’m logged in. What’s the trick?

The trick is to actually SAVE the preference change after switching to mode on.

(Don’t mind me, just looking for my wits.)

Offline

#24 2018-04-03 09:05:52

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: smd_at_work: click to put your site in maintenance mode

Working great.

One suggestion, because I have to be clever in my error message… Maybe use a textarea field instead of the input, which is kind of hard to edit in.

Offline

Board footer

Powered by FluxBB