Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it un-ignorably obvious when you're editing a non-canonical environment #5

Closed
MatthewEppelsheimer opened this issue Sep 29, 2015 · 4 comments

Comments

@MatthewEppelsheimer
Copy link

Here's an enhancement idea, that I'm willing to write code for, but want to get a 👍 from project owners first. I could see this idea being judged as an entirely separate plugin, but for me it is the feature that's missing to make this really great. Please let me know if you see it as a good fit.

There would be two steps to this:

  1. Extend the ENVIRONMENT constant to optionally support meta data through nested arrays. Strings will still work, but you could now do something like this:
$envs = array(
  'development' => array(
    'url' => 'http://example.dev',
    'canonical' => false
  ),
  'staging'     => array(
    'url' => 'http://staging.example.com',
    'canonical' => false
  ),
  'production'  => 'http://example.com'
);
define('ENVIRONMENTS', serialize($envs));
  1. If the environment is not canonical, add an Admin notice with filterable text that conveys essentially "whoa be super careful!", and change the color of the admin bar to something eye catching, like bright red or orange.

The color, too, should probably be filterable. And since a user's admin color scheme is dynamic, this will need to account for that somehow — that bit will take some research.

@swalkinshaw
Copy link
Member

Isn't the canonical URL always going to be production? If so you can just check for that to add your notices (which is a good idea btw).

@MatthewEppelsheimer
Copy link
Author

In most cases yes, but not necessarily.

There are times when we're treating staging (or yet another instance) as
canonical, to stage content edit work before migrating it over to
production, especially during early phases of a site build.

So, which instance is canonical changes regularly throughout our workflows.
In fact it's those transition points that throw people off. This is why we
need this kind of obvious reminder, to help people remember when it has
changed.

On Tue, Sep 29, 2015 at 8:39 AM, Scott Walkinshaw notifications@github.com
wrote:

Isn't the canonical URL always going to be production? If so you can just
check for that to add your notices (which is a good idea btw).


Reply to this email directly or view it on GitHub
#5 (comment)
.

Matthew Eppelsheimer
Rocket Lift

(503) 928-3478
matthew@rocketlift.com

I write a newsletter where I share the best articles and podcasts I find on
excellence in digital publishing. Reply with email subject “Subscribe to
Excellence” to join.

@swalkinshaw
Copy link
Member

@MatthewEppelsheimer in the use case you explained you'd still need to make changes to your config and move the canonical element to the other env array. The solution I proposed would involve changing a conditional check from production to staging for example. It's basically the same amount of work.

I'm just hesitant to support this because I'd rather people not start adding a lot of other data to ENVIRONMENTS. Having to serialize is bad enough as it is.

@MatthewEppelsheimer
Copy link
Author

Your hesitation makes sense and has spurred a lot more thinking that isn't worth going into here.

Let's close this. On my side, we need to get more clear on how best to solve our problem. Thank you for the discussion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants