PDA

View Full Version : Theme Framework Design



jamestl2
05-06-2012, 08:29 PM
Hey guys,

I've been using a framework for the Wordpress Themes I develop and sell for a while now, however, I don't like the way they're currently integrated. Right now all the framework files rest in a separate directory within each theme. The problem with this is that each time I make a tweak to the framework itself, I would have to update every theme's files individually, which becomes a longer, more difficult task every time I design and create a new theme.

A few facts about the framework:
- It's a collection of code and features that the various themes use / need to function properly.
- It currently follows the "Drop In (http://codex.wordpress.org/Theme_Frameworks#Types_of_Theme_Frameworks)" functionality.
- Themes have an autoupgrade functionality that go into detail here (http://konstruktors.com/blog/wordpress/2538-automatic-updates-for-plugins-and-themes-hosted-outside-wordpress-extend/).

I'm thinking I should try to keep the framework files separate from the theme files, but I'm not entirely sure how to go about it. Should I put all the framework code into a plugin? Doing that however creates an extra installation step user-wise, and I want to keep things as simple as possible for them? Should I convert the framework and themes into a parent / child relationship? Going this route however doesn't make a whole lot of sense in that the framework isn't really designed to be standalone, as I mention in the facts, it's just a collection of code and functions for the themes to use, and again, another step for the end user to follow.

Or are there other ways to structure things here that I may not be thinking of? What do you guys think?

jamestl2
05-14-2012, 04:13 PM
No ideas then?

krymson
05-14-2012, 06:07 PM
I use WP but i dont mess with frameworks, I just create my own themes and options based on client needs.

jamestl2
05-16-2012, 02:45 PM
That's not exactly the question I'm asking about ;)

Harold Mansfield
05-16-2012, 04:33 PM
First let me say that I'm not a big fan of Frameworks. I like WP in it's natural form, and themes that don't try and recreate the wheel. Most times it causes problems for me when I want to customize something. IMO, Frameworks and Shortcodes are way overused in Theme design and end up being more trouble than they are worth for both me and my clients.

I'd much rather have a well designed plug in that adds functionality when I need it, rather than a framework that tries to guess my needs and adds a bunch of stuff that I don't need, or conflicts with what I want to do.

With that said, don't most frameworks include all of the files with the theme? Such as Genesis and Thesis?

I think it depends on your market. If you are targeting end users and do it yourselfers, then I'd say make it as simple for them as possible.
If you are targeting service providers that work with WordPress, if they are like me, they don't like frameworks to begin with, so it doesn't matter.

jamestl2
05-16-2012, 04:58 PM
Maybe "Framework" is the wrong term to use, all my "framework" does is keeps a consistent set of styles, rules, features, conditionals, and functions that I include with all my themes. It isn't meant to be this big, advanced collection of fancy code.



With that said, don't most frameworks include all of the files with the theme? Such as Genesis and Thesis?


I'm not sure about those two, but that's the way I have it set up now, the theme's just have a "framework" folder within each theme. Like I said in my OP though, the dilemma with that is every time I make a tweak to the framework, I'll have to update every theme that runs on it, which could take a very long time to do, and isn't very efficient.

Harold Mansfield
05-16-2012, 05:51 PM
I've been thinking about this for a different application. If you can get your theme in the WordPress repository, that will solve the problem. You'll only need to make one update and the user can update through their dashboard just like everything else.

Or you'll need to build a simular update system that ties into the users dashboard.

jamestl2
05-16-2012, 05:59 PM
I already do use an "update system (http://konstruktors.com/blog/wordpress/2538-automatic-updates-for-plugins-and-themes-hosted-outside-wordpress-extend/)" for the themes, which works great. The problem is I'd have to update every theme I have if I were to make any framework changes with the way it's set up now.

Harold Mansfield
05-16-2012, 06:01 PM
Then it seems to me the only way to have the updates go across the board is to make the functions a plug in.

jamestl2
05-16-2012, 06:06 PM
Would a plugin be the best choice to go both user-wise and developer-wise?

Putting everything into a plugin makes things very easy from a developer standpoint, however, is that extra installation step worth it towards casual clients? Or is that a turn-off for them to do that bit of extra work and add that extra step?

Just thinking about how to make this as easy as possible.

Harold Mansfield
05-16-2012, 06:08 PM
But you are trying to make it easier for YOU, not the user. If you want it easier for the user, automatic updates for the theme is the way to go.
If you are trying to make things easier for you and updating each theme is too much work, then you'll have to seperate the functionality from the theme so that you only have to update one thing.

jamestl2
05-16-2012, 06:12 PM
I'm trying to make things easiest for BOTH of us.

If I eventually develop 100 themes, and I make a few tweaks to the framework every week or two (or however long), then that means I'll have to update *100* different files for each update (twice that or more if I edit more than one file). That current setup doesn't sound like a viable solution at all from a developer standpoint.

Harold Mansfield
05-16-2012, 06:16 PM
Do a few themes well. 100 or even 50, or even 20 is far too many for one person to support. Even the larger theme designers don't have 1 guy doing 100 themes.
But, you know as well as I do, when thier themes have an update, they update each one.
As far as an across the board, update every theme solution. I can't see it. Especially since the themes aren't indentical in function.

The way I see it, you have 2 choices. Update each theme as needed, or put everything in a plug in and update just that. One is more conveneint for the customer, the other is more conveneint for you.
Which is more important?

I dont' see any other solutions, unless you build one.

jamestl2
05-16-2012, 06:24 PM
OK thanks, I guess I'll have to think about which way will be best to go.

I thought maybe there was a solution out there where you could just update a portion of a theme or something, or perhaps there was a better place to hold the framework files, etc.

Harold Mansfield
05-16-2012, 06:26 PM
Not that know of, but VG may know of something. Maybe a way to piggyback what you already have that just tagets certain files.
If you are only updating the same files of each theme, and they are all identical, why couldn't you just categorize all themes as being the same update?

jamestl2
05-16-2012, 06:32 PM
The update script I found uploads and overwrites every file in the theme, on a theme-by-theme basis.

Harold Mansfield
05-16-2012, 06:34 PM
I'll have to defer to VG on this one. If there is a way, I'm sure he'll have some ideas. Sounds like you may have to build a script that directs your updates where you want them to go from a central update file.

jamestl2
05-16-2012, 06:37 PM
OK, thanks for the input, appreciate it. :)