bigspring / monolith

A starter theme for WordPress built with Twitter Bootstrap
MIT License
9 stars 1 forks source link

Shards #146

Open jrgmartin opened 10 years ago

jrgmartin commented 10 years ago

Self contained commonly used functionality that can be installed via WP plugins, each maintained in its own GitHub repo.

To be decided

All shards will be stored in a folder within Monolith. These shards should be installable through a CLI long term, but install a manual install is fine.

The main consideration is around the use of theme files. There should be default layout files bundled the shard, but these can be overridden through the theme if required.

The logic for theme files is as follows:

is it a CPT? single? is there a override layout file? yes -> use it (e.g. build(content-[[event]])) is there a default in shards? yes -> use it (e.g. .build(shards/content-event)) no? use build(content)

  CPT archive? 
    no -> use snippets
    yes -> use it
juliotaylor commented 10 years ago

I've been thinking about ways of doing this. For example things like "Case Studies" is something we end up doing often; a CPT, archive views, and so on.

I think this is a prime candidate for modular additions; I still think plugins is the best to do this.

jrgmartin commented 10 years ago

Plugins are definitely the best way to do this as it means we can have self contained functionality.

juliotaylor commented 10 years ago

@simonpmiles I've collected all of them here, but feel free to split them into their own issues if it's easier to manage. Although we should maybe track them al from here and then make repos for each.

juliotaylor commented 10 years ago

@dmseaton @simonpmiles @jrgmartin my main concern around maintaining plugins for each of these add ons is the amount of code duplication and maintenance we'll need to do long term.

what if the shards only contain a couple of essential files (views, functions etc) and we install them into Monolith either manually (via download) or via command line?

Could we do a simple CLI tool that could install a shard directly from GitHub into a specific place within monolith? Rather than a full-on WP plugin.

I'm also concerned about plugins causing security risks.

Alternatively, we could include them all into the theme (as @jrgmartin suggested), and they can be enabled / disabled via the config file.

jrgmartin commented 10 years ago

It feels like we're breaking out of Wordpress in that we're providing a fully featured theme, when really these small instances within the WP architecture should be plugins.

Having them as plugins would also mean that we could use them on any other website that isn't powered by monolith. That's not a big issue, but could be useful for sites where

It's also useful having them as plugins for debugging. If you run into an issue and need to identify that it's a problem with the plugin or theme, you would switch the theme to one of the default WP ones and test. Obviously if they're included in the theme then we wouldn't be able to do this.

I'm still in two minds about this, but instincts tell me that plugins is still the way forward.

FYI - Plugins will only be an issue for security if we're using third party scripts, so I don't think that's a major consideration here.

juliotaylor commented 10 years ago

So, any more thoughts on this? @simonpmiles @dmseaton @jrgmartin

Last discussion was to have some sort of internal plugin architecture, to avoid potential issues with being able to access templates and overrides, etc.

simonpmiles commented 10 years ago

I think we just need to sit down and write a spec for each in terms of how it should work and what it should look like. Then it's just a case of booking the time to build them I guess

juliotaylor commented 10 years ago

Yes, but we still need an architecture for how Monolith will handle the plugins / shards

juliotaylor commented 9 years ago

@bigspring/ninjas this has lost momentum due to abandonment. Anyone fancy picking it up?

jrgmartin commented 9 years ago

I'm happy to pick this up but don't reckon it'll be until you're back and we're at full strength.