How To Hack Safely While Your Readers Are Reading  

Recently, while I'm hacking something new, I try to hack right on this very blog. The reason is that there's a lot of useful data: posts, comments, labels, etc. to work with, rather than on a test blog, where I'm quickly get tired of doing the "Ipsum laura etcetera" ... cut-and-paste thingy :) This might cause some troubles, for some readers might have noticed something abnormal is going on.

Well, I notice that if we're logged in as admin, then each widget has that little editing button. Come to find out, there are two spans elements that wrap that icon, so it would only show up if you're the owner.

Great! Now I will be able to hack/test my hacking widget by wrapping the same spans and the users wouldn't notice a thing, since it's invisible to them.

If you want to do that, wrap these four bold lines around any widget's main includable:



Here's the easy cut-n-paste bold text, in a live example:

<b:widget id='LinkList1' locked='false' title='Interesting Links' type='LinkList'>
<b:includable id='main'>
  <span class='widget-item-control'>
  <span class='item-control blog-admin'>

<b:if cond='data:title'><h2><data:title/></h2></b:if>
 <div class='widget-content'>
   <ul>
     <b:loop values='data:links' var='link'>
       <li><a expr:href='data:link.target'><data:link.name/></a></li>
     </b:loop>
   </ul>
   <!-- <b:include name='quickedit'/> -->
 </div>
</span>
</span>

</b:includable>
</b:widget>


and your testing widget will be invisible to your readers:



but not to you:



Also, make sure you comment out the editing icon (the line in italic style,) since I don't know what's in there (it's sort of like a global function, provided by Blogger template somewhere.)

If right now you don't see my "Interesting Links", that is because my voo-doo is in effect :) I'll keep it that way for a couple of days, for the widget to rest for a while.

Happy (invisible) Hacking, indeed :))) !!!

Hoctro