Only fill this in if you're a spammer huh? Your name :
Your email :
Your message :
Jun
27th
2007

Widgets

Posted in : Reviews, b2evo 2.0

 graphic showing widgets screen

What are widgets?

Widgets, in the case of b2evolution, are basically skin tag plugins, like the weather plugin; ministats plugin; calendar plugin; and all the others that you normally have floating around in your sidebar. Currently if you want to rearrange the order in your sidebar, or add a new skintag plugin, you have to crack open your skins _main.php and manually add a snippet of code wherever you want the results to be shown.

This method of course has a couple of flaws when it comes to reality. The main flaw it has is that it requires a slight knowledge of php, not a lot but often it's enough to trip up the basic user. The other main flaw is that it requires the ability to be able to ftp files to the server. In a multi blogger environment I'd be very surprised if more than a couple of chosen users had ftp access at all.

This is where widgets come in. From version 2.0 skintag plugins have become Widgets and they work in a very different way, although they're still plugins at heart and can still be added to a skin in the old school way. With widgets, and an appropriate skin that uses them, you no longer need to edit your template to change the order, or even to add new ones, or delete ones you no longer use. Now you can do all that from admin. With a few clicks of your mouse button you're able to add and remove widgets, change their order of appearance, and even choose where they appear in your skin.

The advantages of widgets

The advantages to the basic user are obviously huge, they no longer need to know any php, they don't need ftp access, they don't even have to know what a parameter is. All they need to do is wander over to the admin area for their blog and click buttons, how simple is that! There's also other advantages, skin designers no longer need to think about every possible plugin that might get installed. It's all taken care of for them so all they need to do is to add "containers" to their skin, which is basically a place holder for widgets to fill. Widget designers no longer need to say "crack open your skins _main.php and paste this code snippet wherever you want the answer to appear", which should save a fair few support requests and crashed blogs.

It all sounds to good to be true huh? Simple enough for even the basic users to be able to use, convenient for skin designers who no longer have to worry about what plugins should go where and in which order, and great for blog admins who no longer have to give out ftp accounts to users so they can change their skin.

 graphic showing container code

The problem with core widgets

There's absolutely nothing wrong with the core widgets, as long as you want to use their default output. A prime example is the rss widget which has a hard coded title, part of which is that groovy little orange icon. Unfortunately that groovy little icon has a white background instead of a transparent one which meant it looked bloody awful on a pink skin I was playing with ( don't worry, I won't assult your eyeballs by linking to it ;) ). Now for me that's not a huge problem, I have CVS access so I can convert the background to transparent and upload it to the core for all future versions.

The problem is, I don't actually want the icon in the title for my skin. In this instance, because the title is hard coded, I'd now have to hack a core file to remove the icon, ohhh, and it'd be removed for all of the skins. Now, I've not wandered through all of the core plugins to see if they're equally hard coded, but lets pretend they're not. Lets imagine that I could call the rss widget in my skins _main.php in the old school way, and pass it the title that I want it to use. Great, now I can remove the icon for just the skin(s) I want, so no problem right? ........ Wrong. The moment you put a skintag call in instead of using it as a widget you lose the ability to put it where you want in your sidebar, unless you put all of the widgets in as skintag calls, in the order that you want them. Which kind of defeats the purpose of having widgets in the first place, so now were back to square one :-/

The only real solution to this is to go through the code for all of the core widgets and to convert all of the hard coded values into settings which can be changed on a per blog basis. This would at least allow the user to change the values to something that suits their needs. Although it would also be nice to have widget settings on a per skin basis, this would probably be overkill ;)

 graphic showing plugin code

Summary

I think users and admins are going to love widgets. For the user they get far more control of how their blog looks without having to worry about how to add it to a skin without breaking the skin. The admin advantage is even clearer, no longer do they have to consider either giving users an ftp account so they can alter their own skin, or making the changes for the user, or just telling them "tough shit, that's the way the skin looks". The other bonus for them is they no longer need to change every skin just to install a new plugin.

From the skin designers point of view, there's no longer the need to either try and code for every plugin out there, and ones that might be out there in the future, or if they're anything like me, code for all the plugins I use and sod the rest ;) Now they can create a skin that has the basic skintag parameters, and put a container wherever a user *might* like to have a widget .... hell, they could add one to each and every <div> and give the user complete freedom of choice.

For widget developers it's just made the documentation easier, "click install" is pretty simple to explain, and, if they use parameters well enough they should also be able to cover any skin / situation. Another bonus will be the reduction of "I tried to install the 'foo' plugin, but when I added the php to my skin it didn't work / looked wierd / went tits up / some other reason" support questions to answer.

All in all I think that widgets, like many other things in 2.0, are a great step forward for every part of the user base, from the basic user, to blog admins, to skin designers to plugin developers..... mind you, that's probably why it's version 2.0 and not 1.11 huh? ;)

¥

Trackback URL (right click and copy shortcut/link location)

Trackback url for this post
Note : This trackback url is time limited so use it within 30 minutes or the SpamHound will snarl at you.

http://waffleson.co.uk/z/?k=36612592633103238fcb76d479a2e08cb1a908ef2ed71d0f2

Gary users avatar

Posts : 417

Joined : 04/04/05

Reply to comment 14087 by Gary

Replied on : 06/28/07 @ 06:12 pm #1

Nice post Paul,
Look foward to using widgets.

B)
Gz

What should we do with spammers? You want to play with them

Blog-a-doodle-do :D  http://garysblog.co.uk

 
 
¥åßßå users avatar

Posts : 1057

Joined : 10/05/05

Location : 127.0.0.1

Reply to comment 14090 by ¥åßßå

Replied on : 06/29/07 @ 03:41 pm #2

Me to, then you'll stop bugging me with damn fool questions like "urm ...... so .... tell me ( again ) how I add that to my ..... errr ...... it's called a skin right?" :D

Enjoy your weekend ;)

¥

What should we do with spammers? You want to play with them

I may have opened the door, but you entered of your own free will

 
 
Gary users avatar

Posts : 417

Joined : 04/04/05

Reply to comment 14092 by Gary

Replied on : 06/29/07 @ 04:29 pm #3

LOl, You love it really ??
The reason I keep asking is because you still havn't taught me enough !
or
I have already learnt all my brain can absorb !

Have fun mate, hope the weather hold out for you, its not too much fun BBQ'ing in the rain ;)

Gz

What should we do with spammers? You want to play with them

Blog-a-doodle-do :D  http://garysblog.co.uk

 
 

Replied on : 09/14/07 @ 08:01 pm #4

ahh there... widgets explanation... thanks! will link once I have the Skins2.0 guide posted on my blog..

still on the process of upgrading to 2.0-alpha1 as of this writing..

---------------
Burn them! They're witches and warlocks!!


What should we do with spammers? You want to burn them
 
 
¥åßßå users avatar

Posts : 1057

Joined : 10/05/05

Location : 127.0.0.1

Reply to comment 14229 by ¥åßßå

Replied on : 09/14/07 @ 09:15 pm #5

Burn them! They're witches and warlocks!!


I'm gonna have to add that to my list of answers ;)

¥

What should we do with spammers? You want to play with them

I may have opened the door, but you entered of your own free will

 
 

Replied on : 09/16/07 @ 02:45 pm #6

hehehe... cool!!

:D



What should we do with spammers? You want to Burn them! They're witches and warlocks!!
 
 

Replied on : 09/23/07 @ 02:14 pm #7

Mr Yabba Yabba, there *is* a solution to the "I don't like the icon problem" :p

It's far from being implemented on every widget but, if you look closely, some core and plugin widgets do have parameters editables by the user (yes, I know, too good to be true). You are welcome to add a radio param of the kind 'prefix title width: ()rss on white () rss on black () no icon'.*

You're even welcome to add a bazillion params to all existing widgets.

* the icon is fro white or black background because it's antialiased and IE doesn't support alpha transparent PNGs.

What should we do with spammers? You want to shoot them
 
 
¥åßßå users avatar

Posts : 1057

Joined : 10/05/05

Location : 127.0.0.1

Reply to comment 14266 by ¥åßßå

Replied on : 09/24/07 @ 08:11 am #8

Yeah I'd seen all the parameters, but it was the lack of their implementation on certain widgets that I was moaning about. My post would have been far less interesting if I'd just gone out and fixed them though huh? ;)

Once I get a break from my workload I intend to wander through all the widgets and convert as much as possible to parameters before we get a shdload of "how can I .....?" forum posts ;)

¥

What should we do with spammers? You want to play with them

I may have opened the door, but you entered of your own free will

 
 

Leave a comment

Your email address will not be displayed on this site.
Your URL will be displayed.
About you

Just fill in the bits you want, none of it is required



Your email address will only be used to send you adverts for viagra and rolex watches.



(Line breaks become <br />)
Leave a comment
Code:
=> :!: :?: :idea: :) :D :p B) ;) :> :roll: :oops: :| :-/ :( >:( :'( |-| :>> ;D :)) 88| :lalala: :crazy: >:XX :o
 
 
 

X