Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2005-09-05 08:28:13

jonhicks
Member
From: Oxfordshire UK
Registered: 2004-03-22
Posts: 256
Website

Re: EE style 'turn off site' function

What I’d love is to define a template for a closed site, rather than just a text message. I’m thinking specifically for when I’m updating the design of my site, I’d like to provide an attractive holding page, letting people know that it will be back up soon/in x days/when I can be arsed.


Cheers,
Jon VC#9

Offline

#17 2005-09-06 03:33:54

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: EE style 'turn off site' function

What I’d love is to define a template for a closed site, rather than just a text message. I’m thinking specifically for when I’m updating the design of my site, I’d like to provide an attractive holding page, letting people know that it will be back up soon/in x days/when I can be arsed.

Later on we’ll look at making error pages customizable. Perhaps we can do that in a generic way (say, an enhancement to txp_die()) so that it covers all (or most) error situations – 404’s, site down for maintenance, etc.


Alex

Offline

#18 2005-09-06 04:57:31

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: EE style 'turn off site' function

zem wrote:
Perhaps we can do that in a generic way (say, an enhancement to txp_die()) so that it covers all (or most) error situations – 404’s, site down for maintenance, etc.

I doubt you can achieve that; these are quite different from each other.

By the way, why not use the existing mechanism of the web servers to handle errors ?

Offline

#19 2005-09-06 05:23:32

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: EE style 'turn off site' function

I doubt you can achieve that; these are quite different from each other.

How so? Both require a (mostly) hard-coded xhtml page with space for a message to the user; and a HTTP status code. (I’m talking about the display, not the trigger, which is unique to each type)

By the way, why not use the existing mechanism of the web servers to handle errors ?

Are you talking about the Apache ErrorDoc mechanism?

Because once Apache has handed control to a PHP script, there’s no way for the PHP script to return control to Apache and say “please handle this as an error”. We have to generate our own error pages.


Alex

Offline

#20 2005-09-06 06:28:00

creativesplash
Member
From: Coimbatore, India
Registered: 2005-01-19
Posts: 283
Website

Re: EE style 'turn off site' function

I dont know if you have thought of this idea. (and I am not sure if this is feasable or not)

Can we have something like a Close for maintenance option in the back-end. The moment you do that, the back-end starts publishing to a php file maintenance.php instead of index.php and all calls to index.php are forwarded to maintenance.php which sets the cookie for only admins to view the website.

Another idea..

we can have some conditional tags like …

<code><txp:if_maintenance></code>
Maintenance content here..
<code></txp:if_maintenance></code>
<code><txp:else /></code>
Other content here

This way we can allow partcular parts of the website to be viewed by the public.

I am just a rookie when it comes to PHP. So please take it slow on me.


“Take a point, stretch it into a line, curl it into a circle, twist it into a sphere, and punch through the sphere.”

— Albert Einstein

Offline

#21 2005-09-06 21:29:45

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: EE style 'turn off site' function

zem wrote:
How so? Both require a (mostly) hard-coded xhtml page with space for a message to the user; and a HTTP status code. (I’m talking about the display, not the trigger, which is unique to each type)

Ouch… yes on the http code, nope on the webpage.

The maintenance mode require a page (in the TXP paradigm), a css file, and some content customizable server by server. Thats the easy part.

But the error page require a dedicated webpage (as the maintenance one) including a big search tool and a lot of explanation on how to handle the error (hardly any visitor know how to respond to these, and a significant portion are frightnen by it and quit surfing the website inflicting the error on them). And I think it should include a pre-automated-search based on the strings used in the false (or true for some errors, like a false password for a password protection) URI.

Are you talking about the Apache ErrorDoc mechanism?
Because once Apache has handed control to a PHP script, there’s no way for the PHP script to return control to Apache and say “please handle this as an error”. We have to generate our own error pages.

My bad, I didn’t knew that.

Last edited by Jeremie (2005-09-06 21:30:06)

Offline

#22 2005-09-06 21:31:40

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: EE style 'turn off site' function

creativesplash wrote:
we can have some conditional tags like …
<code><txp:if_maintenance></code>

I disagree on both, espacially this one. Too clumsy imho. The easiest way may be to call for a specific section, or page, with a hardcoded name.

Offline

#23 2005-09-06 21:37:54

jonhicks
Member
From: Oxfordshire UK
Registered: 2004-03-22
Posts: 256
Website

Re: EE style 'turn off site' function

I’m with Jeremie. The ideal would be the ability to specify a template for 404/maintainence in the same way that we have can define a template for a section, or have A template, like comments or comments-form forms.


Cheers,
Jon VC#9

Offline

#24 2005-09-06 21:57:04

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: EE style 'turn off site' function

As mentioned by Alex, if you don’t include or echo any content after setting a 404 header, your visitor gets a completely blank page. You add a 404 error page preference under advanced preferences, to set which page to show when Textpatterrn returns the 404 header. Those interested could add a search or whatever they want to it (remember searching is very customizable now), but by default you get a basic page explaining what the problem is. I do that for my site. Simple and effective. Would work well for a maintenance mode too, though obviously it needs more actual coding to determine when to show it.

Last edited by Mary (2013-01-24 17:33:54)

Offline

#25 2005-09-06 23:25:27

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: EE style 'turn off site' function

Mary, this is what I was talking about. Well mostly, I still think an automated search would be quite useful.

But by the way, I don’t see any strings in prefs or advanced prefs related to the 404 handling (with a #891 install).

Offline

#26 2005-09-06 23:39:28

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: EE style 'turn off site' function

I’m speaking in terms of how it could be accomplished, as opposed to an already existing feature. :)

Offline

#27 2005-09-07 00:57:34

LeeStewart
Archived Plugin Author
From: Boston, MA, US
Registered: 2005-07-25
Posts: 81
Website

Re: EE style 'turn off site' function

> mary wrote:
> You add a 404 error page preference under advanced preferences,

I don’t see that, it’s available in Textpattern 4.0.1 (r888)? Am I totally blind?

[Lee]


Monkeys could have written a better post..

Offline

#28 2005-09-07 02:18:48

KurtRaschke
Plugin Author
Registered: 2004-05-16
Posts: 275

Re: EE style 'turn off site' function

LeeStewart wrote:
> mary wrote:
> You add a 404 error page preference under advanced preferences,
I don’t see that, it’s available in Textpattern 4.0.1 (r888)? Am I totally blind?
[Lee]

Quoting mary’s earlier post:

I’m speaking in terms of how it could be accomplished, as opposed to an already existing feature. :)

So it doesn’t actually exist yet.

-Kurt


kurt@kurtraschke.com

Offline

#29 2005-09-07 02:24:32

LeeStewart
Archived Plugin Author
From: Boston, MA, US
Registered: 2005-07-25
Posts: 81
Website

Re: EE style 'turn off site' function

sigh I need to pay more attention.

Looks like my plugin will be the first that uses the new 404 callback code! The next version of my plugin will have generic 404 code, the final version will redirect based on the filename…

[Lee]


Monkeys could have written a better post..

Offline

#30 2005-09-07 07:07:25

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: EE style 'turn off site' function

mary wrote:
I’m speaking in terms of how it could be accomplished, as opposed to an already existing feature. :)

Ok, so yes I was speaking about the same thing too. But with some kind of granularity, aka in Adv Prefs severals options :

  • template for 404
  • template for 403
  • template for 401
    … and so on
  • template for maintenance, or file to output

Replace “template” by page, form, or even section; depending on how it’s implemented.

Or, one can use the hardcoded name section/page/form for the job, aka a “error 404” page for example.

But I still think a pre-automated-search would be quite nice. Not many software does it right now, each and everyone of them will do it down the road – maybe one, or two year from now. Because, quite simply, it’s the easiest and more practical way of handling error for non geeks.

Offline

Board footer

Powered by FluxBB