Friday, September 11, 2009

Blog design tip - Keeping your widgets when you modify your blog design

See? I told you I'd get around to some of these posts that I mentioned.

Thanks to my friend (who is not my brother, in case you were wondering), Jessica, I was reminded that some people lose their widgets when they redesign their blogs. With this little trick, you'll be able to add your widgets back into your HTML after you've added the new template, thereby avoiding having to add them all back one-by-one!

At the bottom of your HTML code, you'll find some code that looks something like this:
<div id='sidebar-wrapper'>
<b:section class='sidebar' id='sidebar' preferred='yes'>
<b:widget id='HTML1' locked='false' title='My real blog' type='HTML'/>
<b:widget id='BlogArchive1' locked='false' title='Blog Archive' type='BlogArchive'/>
<b:widget id='Label1' locked='false' title='Labels' type='Label'/>
<b:widget id='Profile1' locked='false' title='About Me' type='Profile'/>
</b:section>
</div>

The sections that begin with <b:widget id= are what identify your widgets. There will be <b:widget id= identifiers in every section that you have widgets. For example, if you have widgets in your footer too, be sure and find them in the </div id='footer-wrapper'> section as well.

Take the sections of code that have widgets in them and copy them into a word document so you can save them when you change your code (actually, it's a good idea to copy all of your code into a word document before you start messing with it so you can go back if you screw it up). 

Modify your code as needed, then copy the widgets back into your new code in the same places. Viola! You have your widgets back!

This is also useful information if you want to move a lot of widgets at once, such as moving all the ones on your left sidebar to the right sidebar. Simply copy all the widgets from one side and move them to the other and vice versa. Works like a charm!

Leave any blog design or other questions in the comments and I'll try to answer them in my next blog design tip post!

0 comments: