Not sure if this is exactly what you are looking for - development environment based on entries or templates.
What we do is use a set of assigned variables at the top of EVERY template even if not all variables are used in that template (important for the find/replace function, read on and you’ll see why).
Then in every single path, permalink, embed, etc, use the assigned variable for the template group.
For example:
{assign_variable:main_group="site"}
{assign_variable:lib_group="home"}
{embed="{lib_group}/.header" page_title="Welcome"}
<div id="nav">
<a href="http://{path={main_group}/index">Home</a>
<a href="http://{path={main_group}/about">About</a>
</div>
So, with this scenario we have two template groups: site and lib (short for library).
When site is launched and we need to start working on more templates, make modification to existing templates, etc - we duplicate all the groups, adding _dev to each group’s name. In this example, we would create site_dev and lib_dev. Then we do a find/replace of the assigned variables in the newly created dev groups like so:
Find
{assign_variable:main_group="site"}
{assign_variable:lib_group="home"}
Replace with
{assign_variable:main_group="site_dev"}
{assign_variable:lib_group="home_dev"}
Then every time we finish with changes and are ready, we “push” dev to live by shutting down the site, backing up the original groups by renaming something like site_backup, and then duplicating the dev groups. In this example, we’d be duplicating site_dev and lib_dev.
Then, do a find replace on the new groups like so:
Find
{assign_variable:main_group="site_dev"}
{assign_variable:lib_group="home_dev"}
Replace with
{assign_variable:main_group="site"}
{assign_variable:lib_group="home"}
Double check everything on the (offline) live site to make sure you did good. Then turn the site back online and after a few days or weeks, delete or store offline the backup versions, whatever toots your horn.
This is useful only if you have a really big site with lots of moving parts, though. And you can royally screw up easily with one step, only the most careful, meticulous person who knows EE well should be in charge of pushing dev to live. It saves time and allows us to work comfortably in the dev version, fully test out new functionality, etc without worrying about screwing up the live site.
Is this the best method? Probably not. A little crazy, maybe. But it’s pretty easy once you get the hang of it, have the system set up… it only takes 15 minutes to push dev to live. And it’s a 100% EE based solution, no worrying about integrating with another solution such as file versioning like Subversion, saving templates as files, etc etc.
I’m curious to see if anyone else thinks that it’s a good way to handle development versions of sites or not. A while ago I needed to set up a dev version and didn’t have time to get all involved with researching best solutions, etc, and thought of this simple solution and it ended up serving our purposes great and we’ve stuck with that method for a while now.
Oh, also - in case it’s not already obvious, the main reason we are sure to use assigned variable for every single reference to a template group is so that everything in _dev links to one another in all _dev groups - while everything in the live site links to one another. It basically allows us to fully maintain two “mirror” sites.
Note that there is no security set up with this scenario - my perspective is that if someone unwittingly stumbles on the dev version, most likely through search engine, it is a mirror site anyway so they should see pretty much the same thing as the live site - if they hit a dead page because we’re fiddling with it, oh well, it happens. I’m not crazy about leaving dev wide open - it’s just tricky figuring out a way to lock the dev version without creating a lot of additional work to “unlock” once dev is pushed to live. Probably a plugin or something would resolve that.
Hope that helps! 😊