This is my first widget for Blogger. Since it uses Widget Tags for Layout, therefore you must install it manually by putting code into your template.
Current Version is 0.1, released on 2008-09-25, licensed under the LGPLv3.
Contents
1 Features
- Customizations of the minimum/maximum font size and font size unit.
- Limiting the number of Labels, e.g. top 100 or last 100 in counts (I wonder if really someone will try to list last 100 labels)
- Sorting by Labels’ names or their counts.
2 Installation
Please follow these steps:
- Download your current template and save it to where you can’t forget.
- (Optional) Remove the current Label gadget, this is not necessary but in order to reduce the confusion to whom doesn’t know anything about XML/HTML/JavaScript.
- Edit Layout template.
- Assume that you want to put it at sidebar, search for <b:section class='sidebar' id='sidebar' preferred='yes'>, which starts the sidebar. From there, search for </b:section>, which ends the sidebar.
- Now copy the entire code from here, and paste the code just above </b:section>.
- If you didn’t skip Step 2, then just save. If there was a Label widget and you didn’t remove it, you need to modify a line in the code which you just paste into your template, read explanation of LblCldTarget in next section Parameters.
- If Blogger shows no error, check the bottom of your sidebar.
- (Optional) Move the new LabelCloud to a proper position in Layout/Page Element.
3 Parameters
Please open this syntax highlighted code in new tab/window. The parameters are at Line 29 to Line 35:
- LblCldTitle: The title of this LabelCloud widget. You can simply remove this line if you don’t need a title. You can manually edit it or use Layout/Page Element to set a title just as if you do for normal gadgets.
- LblCldMinFontSize/LblCldMaxFontSize/LblCldFontSizeUnit: Settings for font sizes of Labels. Default are 1.0/2.0/em, which means 1em to 2em.
- LblCldLimit: How many labels to be shown. If you want the top 100 in most count, then it’s -100 (Note that the minus), which is also the default. If you want to top 15 in least count, then it’s 15.
- LblCldSortByName: If you want the labels get sorted by name (a->z…), then set it to true. Other values will sort by their counts (0->9…).
- LblCldTarget: This variable is very important. If you set it wrong, then you will get nothing. If you only have one Label/LabelCloud widget, then the value Label1 will work. If you have more than one, scroll up (after save) to see <b:widget id='Label?' locked='false' title='LabelCloud' type='Label'>. Set this value to Label? whatever you read.
4 Having Troubles?
If you have some problems to install, please must provide:
- (Required) Your blog address. This is nothing about fixing your problem, I just want to read your blog.
- (Required) Your template (after installed my code). You can use pastebin, please don’t directly post your template here.
- If you have JavaScript debugging console, please also provide the error messages if any.
- Anything else which you think you should tell me.
- (Optional) You can also leave your msn/Skype account, I might contact you.
I may try to help if your template isn’t modified too much. Please remember I don’t guarantee that I will help.
If you believe that you find a bug, leave a comment or create an issue in tracker.
5 Any Ideas?
If you have any ideas to improve, feel free to leave a comment with your ideas. If you are familiar with Google Code Issue tracker, go ahead to create one.
6 Technical Information
If you are interested to read more:
- Depends JavaScript. No JavaScript No LabelCloud.
- Depends on prototype.js, which is served from Google AJAX Libraries API. I use it to sort labels and add HTML elements.
- LabelCloud is composite of LabelCloud.xml and LabelCloud.js. The content of LabelCloud.xml is what you need to put into your template. You can read the processing JavaScript LabelCloud.js at Google Code.
- Only tested in Firefox 3 on Linux.
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.