Forum
Webpage Development Mode
Hi all,
Does anyone know of a way that I could modify Perch to show a checkbox next to each page that I could check when undergoing development on that page? Ideally, I would like to implement this on all pages so that when that part of the website is undergoing development, website visitors would be redirected to a page that says "That page is undergoing maintenance at the moment"...
Any suggestions greatly appreciated.
Hello Conor,
If the page has never been live, it's probably better you don't publish it until you've completed development in a local environment.
Anyway, a possible solution for this would be to use page attributes. The following adds a checkbox to the Details tab of the page in the control panel.
templates/pages/attributes/default.html
:templates/pages/attributes/dev.html
:page.php
:Thanks Hussein! I’ll try that tonight.
Hussein... your solution... it just works...
It's brilliant, thank you!
Yes Hussein, your reply inspires a few thought for me, and I think that’s a good solution you suggest.
While I do no live development since I have a dev setup on my local machine, your response could be used to limit access while under live development.
I added the final piece of code to the Perch runtime - is this ok? Or will this get overwritten in an update?
It just means that I don't have to go through every single page and add the snippet.
The only problem I am now faced with is that I, myself, cannot see the page :') So I have no idea what it looks like while I am developing it - this may take more thought - as you were.
Oh right! I believe you can check whether you are logged into Perch as Drew mentions here.
So combine that with what we have:
Please do not change core Perch code. If you do so we can no longer offer support.
Runway includes a site behind login mode as a feature that allows you to put the site in development so it can only be seen by people logged in with an admin account.
Hi Rachel. I am not changing the core code, it would only be the runtime inside perch (not core) - does this still count? I noticed this file was only including the core runtime code so thought this would be ok.
And thanks again, Hussein.
If you want to add code into the runtime chain then you can do it with an app.