-
FreshTags' Static Widgets
- body
-
This enhancement to FreshTags in response to Amit, who has been persistently requesting the feature in comments and a ticket. FreshTags now has the ability to generate widgets (from any source) which are locked on to a particular tag(s). For example:
<!-- FreshTags0.5-Singpolyma2 -->
<script type="text/javascript">
if(typeof(WidgetData) != 'object') WidgetData = {};
if(typeof(WidgetData['freshtags']) != 'object') WidgetData['freshtags'] = {};
WidgetData['freshtags']['freshtags_static'] = {
"type":"posts",
"source":"source",
"format":"drop",
"defs":"tags",
"force_defs":true,
"username":"del.icio.us username",
"url":"blog url",
"join_char":"/",
"tag_url":"/search/label/%tags%",
"sort":"alpha",
"rows":100
};
</script>
<script src="http://jscripts.ning.com/get.php?xn_auth=no&id=818185" type="text/javascript"></script>
<div id="freshtags_static"></div>
<a href="http://ghill.customer.netspace.net.au/freshtags/" title="Categories by FreshTags"><img alt="FreshTags" src=" http://ghill.customer.netspace.net.au/freshtags/freshtags-btn.png"/></a>
<!– /FreshTags0.5-Singpolyma2 –>
The above code must (for new Blogger users) be inserted into a new HTML/JavaScript sidebar widget. Source (in red) must be either del.icio.us, blogger, or mediawiki (use blogger for labels on posts in the new Blogger). Defs (in red) should be a +-separated list of tags to load into the widget (or just one tag). Username (in blue) must be replaced with your del.icio.us username (if source is del.icio.us) or the whole line must be removed. URL (in blue) must be replaced with the full URL to your Blogger blog (ie, http://you.blogspot.com/) if source is blogger or the whole line must be removed. Join_char (in blue) must be / if source is blogger and + otherwise.The ID (in purple) is fine to leave if you are only going to insert this widget once. For the second, third, etc widgets you must change it to something like freshtags_static2. The higher reference (also in purple) to freshtags_static must also be changed. Second, third, etc widgets do not need the <script> tag that is in purple near the end.
If you have any questions, just ask!
-
FreshTaggy Goodness
- body
-
FreshTags' core has been without update for quite some time (and, I believe, does not even render properly on the New Blogger. My version has not fared much better (although I did upgrade it to work with the new blogger
). Now it is time for some improvements!For Blogger
Full integration with the New Blogger labels system! You have to paste a small code into your sidebar, and then FreshTags will pull its data directly from your local labels! Great for new users or people who have fully migrated. Best of all, to install this takes only a few steps on the wizard. Select 'Blogger' as the data source, enter your blog URL, change any other settings you might want, and click 'Generate Code'. Copy the code presented into your sidebar and then click the generated button to instantly install the widget with your settings! (Does not work on FTP blogs.)For Everywhere
There are now three wizards for my version of FreshTags. There is one to generate the JSON for individual widgets (hackers). There is one to generate the full code for anywhere (some knowledge necessary). Finally there is one that generates a one-click button (or instructions and a button) for the New Blogger.For MediaWiki
That's right. Go over to BloggerHacks to see it in action. FreshTags for MediaWiki! The wizards (above) can generate the code, but it's a bit hackier to integrate with the sidebar. Check out the BloggerHacks Sidebar and Header Section to see how I did it (click the view source wiki tab for wikicode).For WordPress
I have updated FreshTags for Wordpress (with the help of my friend, Trevor Creech) to work as a Wordpress Widget. If you don't have widgets on your Wordpress blog, don't worry! It still works the old way.
-
Virtually Synonymous Tags
- body
-
Most of us are aware of the problem. If I tag this post 'web2.0' and you monitor Technorati for the tag 'web20' then we're sunk. You'll never find me. If I tag a webpage on del.icio.us as 'hacks' and you monitor the page for 'hack', you may never see it. These tags are virtually synonymous, but a computer can't tell that.
Enter Tagging, a new Ning app designed to solve this very problem. The app stores groups of virtually synonymous tags (or TagGroups) that are defined by the community and provides easy access to them via both XOXO and JSON(P) APIs. With space to clearly define and describe TagGroups and a coComment catch-all discussion system the community solves their own problem by defining for the system what tags mean the same thing.
For more information see the Tagging About Page.
-
Updates to my version of FreshTags
- body
-
I have been doing some work on my version of the FreshTags concept. The first major addition is the ability to pull in other FreshTags users' data for use in the sidebar. If you look at my links sidebar you'll see a '+' to the left of some items. Only two of these use FreshTags, Freshblog and Ecmanaut. If you click the '+' next to either of these when there is no query tag you will be presented with a list of the newest posts from those blogs. If there is a tag selected, however, you will be presented with a list of posts on those blogs matching that tag, unless they have none in which case the list of newest posts is again presented. The template code to do this (without the show/hide magic) is:
<script type="text/javascript">dynamic_delicious_load('DELICIOUS USER','ANCHOR TAG',function(){write_tagged_posts(false,false,'FEED URL');});</script>
The three parameters passed to write_tagged_posts are:- extendedyes — TRUE to display the contents of the extended field, otherwise FALSE
- hideonnull — TRUE to have blank output if there are no post matches, otherwise FALSE
- feedurl — The URL to the feed for this item, do not pass if you don't know it or don't want to display recent items on no match
- max — # limit of posts to display, not shown in example above
The second major addition is to the fetch_query_tag function. If no tag has been passed to the page, and it cannot find one in the referrer URL then it looks in the current page. It grabs the first rel=tag item and uses the contents of that as query_tag. Thus if a tag cannot be found any other way it finds related posts to the current one. The only minor problem with this addition is that including the JavaScript in the header means fetch_query_tag runs before the page has fully loaded, so it will usually not find anything. I solved this by moving the block that includes the main Delicious.posts and the tagspostpage.js to my sidebar, which is after my posts in my code. If your sidebar comes before your posts you're stuck, because you need it loaded before the sidebar for the list_side_tags function to work. If anyone knows of a way around this I would appreciate knowing.
I was unable to actually hook this to onload (per Johan's comment) because the data must be loaded before list_side_tags or write_tagged_posts can be run. I found a solution in using the callbacks again, and this time list_side_tags will load tags if they are unloaded when called and same for posts for write_tagged_posts. return_tagged_posts can therefore not be called until one of these others (or you call load_data('posts') yourself), however since the main use of return_tagged_posts is at the end of the code, after write_tagged_posts, for use on the inline tags page, this should not be a problem. So autocapture should now work without modifying your template code to move the javascript stuff from the <haed> section.
If you place code similar to:
<MainPage><script type="text/javascript">var no_autocapture = true;</script></MainPage>
in your <head> section it will stop the tag autocapture on your main page (per Richard's comment)



You can trackback from you own site.
19 Comments
test.
Hi Stephen,
I have a few questions and was wondering if you could answer them.
a. What changes to the above code will allow me to add a line like "Select a movie" at the top of the drop-down list? (Similar to -Tags- on your blog here.)
b. Is it possible to have more than one drop-down list in the same widget?
c. Would it be possible to host the JS code on my blog template instead of on ning, including a full credit to you? I'd prefer to have the code at a single domain/server if possible.
Thanks.
-Amit
Add a line like so:
"prompt":"Select a Movie",
Just below the line:
"tag_url":"/search/label/%tags%",
Yes, you can have more than one, read my second paragraph about changing the purple bits of the code.
Host it yourself if you like, just link back to me
>> Yes, you can have more than one, read my second paragraph
>> about changing the purple bits of the code.
I guess I wasn't clear enough, or there is some confusion about the definition of a widget.
I can have more than one widget, but each widget can have only one drop-down list, right? The comments related to purple code are for adding new widgets.
If I want to have more than one drop-down lists within ONE widget, is that a possibility, if I repeat the code within the first set of tags?
>> Host it yourself if you like, just link back to me
That's great! I will definitely link it back to you.
So, how do I get the script from you (which is hosted here: http://jscripts.ning.com/get.php?xn_auth=no&id=818185)??
Thanks,
-Amit
PS BTW, the comments are still being eaten once a while by the rogue code
It doesn't matter if you create a new widget on your Blogger blog for the new code, or just paste the code more than once in the same widget, no, code is code.
To get that script, go to that URL and then cut-n-paste into script tags in your template/widget
PS - If you try to use funny characters like < or > without escaping them, you may get eaten
Stephen,
Thanks for your suggestion, and it's working fine. I have multiple drop-down lists within the same widget. Take a look: http://hacksandbox.blogspot.com/
One more question (hopefully, last one):) –
a. Is it possible to specify/fix the length of the drop-down list? Right now, they are of different lengths (I'm assuming it auto-adjusts based on the longest title for each label/tag) and I'd like them all to be of the same length.
Thanks again.
-Amit
You might try something like this:
<style type="text/css">
.showtitle {width: 150px;}
</style>
Great! Worked like a charm!!
:)
Thanks soo much!
-Amit
Stephen,
Does this limit the number of posts to 25? Take a look here:
http://cross-cut.blogspot.com/
and the drop-down list that says "List of Movies (A-Z)"
It does not show 5 movies in the list (I have 30 posts so far), and those 5 are the first 5. Just wondering if it will only show the latest 25 movies, or if I made a mistake somewhere.
Rest all drop-down lists are working fine!
Thanks!
-Amit
@Amit — I think I've now fixed that bug… but cannot test your situation because your blog has the code inline instead of from JScripts. Upgrade it and it should work
Stephen,
Thanks for the prompt response. I tried including your new code, but it didn't show the drop-down lists. The code was posted between the includabe tag ('quickedit') for widget id=HTML4 at http://hacksandbox.blogspot.com/ (that's where I test the code/hacks). It's the same place as in the new blog http://cross-cut.blogspot.com/ where the old code is.
So, I deleted the code, and instead, inserted the script source code lines to your URL for the source code in the widget for "List of All Movies", and it's still not working.
The last two drop-down lists are working but those were generated using the FreshTaggy wizard.
-Amit
@Amit - to clarify — you now have the script included from JScripts again, but A-Z is still only showing 25?
Stephen,
Yes that is correct. I modified the code at http://hacksandbox.blogspot.com/ to refer to the code at JScripts (instead of being inline) and it is not showing the drop-down lists now.
Take a look when you get a chance. Glad that your blog is back up.
Thanks.
-Amit
Hi Stephen,
Hope you landed a job. I would like to trouble you again to see if you've had a chance to figure out the limit of 25 post titles using your code. I now have posts (movie titles) that exceed 25, so some of them are not showing up in the drop-down list. Feel free to leave a comment on my blog. Also, if you feel like running some tests, my other blog does not embed code. http://hacksandbox.blogspot.com/
Thanks!
-Amit
Oops, that should be "… figure out a way around the limit of 25 posts … "
@Amit — haven't found an easy solution yet
Stephen, thanks for your response! C'est la vie, I guess.
Post a Comment