I’m calling on the WordPress community including the core to do what they do best, create elegant solutions to rather complicated problems. You all know my fondness for WordPress but not even I think it’s perfect. That’s right, I said it, there are some areas that need improvement. That being sad I’m not gonna sit around and complain about it. I would like to suggest a change to Sidebars and Widgets and I hope you’ll work with me, debate me and even criticize me so we can come up with the best solution and move forward.
Currently there are two problems with Sidebars and Widgets. One, they are not exactly semantic, defining sidebars that are actually just widget holders in the header, footer or aside of your website doesn’t really make sense. Two, “Sidebars” are theme dependent which means if you change themes you’ll lose your sidebars and widgets.
As far as I can tell Widgets are they only area of content that is lost during a theme change. WordPress as a whole works so well at separating content from themes. I tell my clients that the best thing they can do for their website is convert to WordPress with a good site architecture in place because this can last forever. Themes will come and go but a well laid out, completely dynamic website goes the distance.
How Menus Can Help
WordPress 3.0 came with one of my favorite advancements since I started working with WordPress. I’m sure if I asked you to guess what I’m talking about you’d quickly shout out “MENUS!” and you’d be right. Menus made it so easy for us to create custom and multiple navigations throughout our websites and combining Menus with CPT’s took WordPress beyond being “just a blogging cms”.
The simple drag and drop nature of menus makes it easy for Users Admins to make changes and edit their site, giving them more control and freedom. We also see that Menus are created by User Admins, which means they are theme independent. No matter how many themes are activated during the life of your WordPress website, your menus will remain unharmed and unaltered.
Theme developers are given the ability to define Menus Locations.
Menu locations allow for User Admins to define where their menus will appear in the theme. I can create a “Main” menu and assign it the “Main Navigation” location which you can see above.
I propose that Sidebars and Widgets work exactly the same way. As a User Admin you can define “Widget Holders” (we can use a more elegant term) similar to defining menus. Once these holders are defined we can fill them with widgets and order them how we like.
Theme developers will then define “Widget Holder Locations” (currently known as sidebars but again we’ll come up with a more semantic and elegant naming convention). Once these locations are defined we can select which widget holders to place in each location in the same manner we define menu locations.
This immediately separates widgets from the theme allowing them to remain accessible and available to the User Admin regardless of how many times they change themes.
We already mentioned “Theme Independence” but what does that really mean? It means that User Admins will not have to worry about duplicating their work every time they change a theme. Imagine all the posts and pages you have in WordPress now, what if I told you that if we install a new theme you’re going to have to go through and re-enter all that content. WordPress would quickly be lost as a cms.
I know how much work is put into defining widgets. I utilize sidebars throughout all my client projects and placing, editing and ordering widgets takes a lot of work. Even defining a new sidebar between two others throws off the entire widget order. It’s tedious and unnecessary!
I also have clients who run specials and monthly campaigns. With this new Sidebar Widget solution we could define as many Widget Holders as we want and later switch them in the Widget Holder Locations. So we can have a traditional aside with “Recent Posts” and other related widgets. We can also define a second widget holder to house our monthly campaign content. When it comes time to run the campaign we can just change our widget holder selection in the location dropdown, just like in the menu area. Saving and restoring widget holders is just the tip of the iceberg in benefits.
It would make sense to allow for widgets to have a on/off switch or even a draft/publish status like posts. All too often I want to hide a widget just temporarily but my only option is to delete it. Maybe I want to turn off a “Live Chat” button that is held in a Plain Text Widget just temporarily. To do this I have to move the widget to the “inactive area” and save it for later. It would be far simpler to keep it where it is but have a toggle show/hide button.
How Do We Get Started?
Well there are a variety of things we can do. First lets discuss if this is the best option. Comment here, start a conversation on Tweet to @wordpress
Go to the forums and discuss. If we all agree this is the best way to move forward then you can do anything from suggesting a change to WordPress or committing code to the core yourself.
The best thing about the WordPress community is that anyone at any level can contribute and make it better. I have been thinking about this a lot lately and it wasn’t until I shared my ideas out loud with a friend, Aaron Ware, that I decided that I was on the right track. From here we can all work together to make this better for everyone. I’ll likely get started working on this myself and if anyone wants to help please let me know.