December 5, 2008

Jeff Chandler wrote a post a few days ago explaining his vision for the WordPress widget system. His post got me thinking so I want to take his vision one step further and look at some of the practical methods of achieving them.

For a wireframe widget system to truly work the wireframe needs to be set up by the theme author before hand. I envisage an area of WordPress.org where a theme author can upload a large screenshot of their theme, and using the tools provided, select the regions where the sidebars are placed. For example:

A theme screenshot with a selection being dragged out

The theme in this example is Clockwork Simple

For each region they select they provide a nice name, and the name of the sidebar within the theme so that WordPress can match them up later on. Once finished they are given an XML file containing the screenshot filename, the coordinates of each region, and the names of each sidebar. The XML file and large screen shot are saved within the theme folder.

When the user installs the theme and navigates to the widgets page they are presented with the list of widgets, as now, but instead of clicking add, they drag the widget to the location they want. For example:

Widget layout with widgets included

I think this process could really create a solid usable widget system, but I also think that more change is required to the process of creating a widget in the first place.

In the scenario described about, and which I wrote about in a previous post — changing layouts using widgets, many more places use widgets to provide options. For example, the main area could contain a single post widget, that is only used for single posts, a multiple post widget, for archives, and a page widget. These do away with the need for multiple template pages as each widget deals with one specific situation. The problem with this is that widgets are too hard to create.

Widgets are simple enough to create for a plugin author, but theme authors should be able to define a PHP file as a widget by adding some code at the top, in the same way as the CSS file contains the theme details.

If the want to create a single post layout with an image on the left they create it as a file and add the widget code. They can then do the same for a single post layout with the image on the right, a larger image with text below it, and so on, without needing to worry about the plugin style code that would be needed in functions.php right now.

In the next few days I will release a plugin that allows widgets to be created from theme files in this way so you can see for yourself how easy things could be. All we need now is the new font end. Roll on 2.8.



Wordpress feature image page?
24 comments on page 1065

Addsettingsfield?
3 comments on page 793

Shorter link?
4 comments on page 1190

Shorter link?
4 comments on page 1190

Cssimageforlogin?
no comment on page 128

Cssimageforlogin?
no comment on page 128

Get featured image url wordpress?
24 comments on page 1065

How to clear wpcache?
9 comments on page 1310

Photo gallry code html5?
6 comments on page 1305

Wordpress get image size?
24 comments on page 1065

Sitecouk wptheme?
2 comments on page 1376

Wordpress chat disqus?
no comment on page 1308

Howtocreategoodsizelayout?
4 comments on page 1026

Friend connect profile?
6 comments on page 1364

Get medium image from post?
24 comments on page 1065

Tabbed widgets wp?
no comment on page 333

Wordpress pictue cache lschen?
9 comments on page 1310

Wordpress plugin post separator?
no comment on page 1371

Display photos html 5?
6 comments on page 1305

Fun wordpress themes?
2 comments on page 1376

Wp featured image without size?
24 comments on page 1065

Wordpress get url global?
4 comments on page 1190

Wp unlimited?
3 comments on page 1141

Html5 image gallery?
6 comments on page 1305

Wordpress exif plugin?
12 comments on page 230

Css login screen?
no comment on page 128

Htlm 5 photo gallery?
6 comments on page 1305

Css login screen?
no comment on page 128

Comments by intensedebate?
7 comments on page 1175

Image gallery html 5?
6 comments on page 1305

Wordpress andrew rickmann?
2 comments on page 1376

Wordpress medium large?
24 comments on page 1065

Fun with uninstallation wordpress?
53 comments on page 100

How to clear wp cache?
9 comments on page 1310

Photoshop frameworks?
3 comments on page 296

Html5 gallery?
6 comments on page 1305

Html 5 photo gallery?
6 comments on page 1305

Login screen css template?
no comment on page 128

Html5 photo gallery code?
6 comments on page 1305

Wordpress post multiple images?
24 comments on page 1065
  every 1991s, 1s ago, in 0.03s.
 __
(__)
   `
 What should 2.8 bring? – WP FUN

[...] options. But it isn’t just the UI that needs attention, although it does, as my post on widget management concepts shows. If you have ever tried to do anything slightly advanced with widgets (see my widget [...]

 __
(__)
   `
 Fun with Theme Widgets – WP FUN

[...] with Theme Widgets Following on from my post about Widget Management Concepts, I have produced a new plugin with the aim of making it super easy to include widgets within themes [...]


0s