Saturday, May 1, 2010

Identify The Gadgets In The Template, Reliably

When you tweak the code in a gadget, based upon my instructions, you'll be editing the template HTML. Or, you might be using the Layout wizard, to locate and remove a problem gadget.

You'll do most editing with widget code unfolded. You'll have a lot of code to sift through - and with many gadgets in your blog, there's always the chance that you'll see the code for one gadget, and confuse it for another.

If you delete or tweak the wrong gadget, you may not like what you get. Before deleting anything, or editing the template, take an extra minute, and find the specific gadget, by its name. This could save you a lot of grief.

Here, I'll look at the Welcome message in my Buzz blog.

This is what I did, as I tweaked it to make it show up only on the Home page.

So, welcome to The Buzz.

If I right click on the screwdriver / wrench ("dragonfly") under that gadget, and select "Copy Link Location" (or possibly "Copy link address"), I can paste the URL into Notepad for easy examination.

Alternately, use the Layout wizard, click on "Edit" - and stretch the gadget window out horizontally, until the entire URL is visible.
http://www.blogger.com/rearrange?blogID=6525860816441104874&widgetType=Text&widgetId=Text1&action=editWidget

The gadget in question is "Text1". To find the code to tweak, I use the Template "Edit HTML" wizard - and completely unfold the code for "Text1".
<b:widget id='Text1' locked='false' title='' type='Text'>
<b:includable id='main'>
<b:if cond='data:blog.url == data:blog.homepageUrl'>
<!-- only display title if it's non-empty -->
<b:if cond='data:title != ""'>
<h2 class='title':gt;<data:title/:gt;</h2>
</b:if>
<div class='widget-content'>
<data:content/>
</div>
</b:if>

<b:include name='quickedit'/>
</b:includable>
</b:widget>
That beats an eyeball based search, any day. It's 100% reliable, and takes just a few seconds to find the code for "Text1". After you do this a few times, you'll be able to hover the mouse, and spot the widgetId=Text1 in the URL display in the browser status area - and go straight to
The gadget in question is "Text1".

(Update 2014/12): If you use a text browser, you can locate and identify a problem gadget, much more easily.

>> Top

Elm0D

Author & Editor

Has laoreet percipitur ad. Vide interesset in mei, no his legimus verterem. Et nostrum imperdiet appellantur usu, mnesarchum referrentur id vim.

0 comments:

Post a Comment

Navigate» Become author for this Blog

Manual Categories