Singpolyma

Archive of "Freshtags"

Archive for the "Freshtags" Category

FreshTags’ Static Widgets

Posted on

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

Posted on

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.

FreshRolls (Wrinks)

Posted on

I have added a new feature to my Wrinks app. In the spirit of FreshTags we have FreshRolls.

If you go to a wrink page (for example, the Blogger Hacks Wrink), you will note a third code option. FreshRolls are currently only available in JavaScript (no PHP yet). You can select what blog to exclude (or none), just as on the normal roll output, and whether this code is to be used in conjuction with ring code or not (more on that in a bit). The code is then a simple JavaScript include, as with standard rolls, that you place where you want the FreshRoll to appear.

FreshRolls attempt to detect tags and ‘passed tags’, just like FreshTags. If it finds some, it will display only those blogs which match the tag(s) found, otherwise it will normally display the entire roll. If, however, you told it you would be using it with a ring, it will not display a roll title and if no tags are detected will output none of the roll.

What is this ‘combo-mode’ useful for? Well, if you paste standard ring code followed directly by FreshRoll code set to ‘combo-mode’, if tags are detected the matching blogs will be displayed following the ring, otherwise you just see the ring. I have set it up this way in my sidebar. You can test it by appending ?tags=blogger to this page’s URL and reloading.

Blogger BETA compatible : Just create a new HTML/JavaScript widget on your BETA blog and cut-n-paste in the code(s) from Wrinks.

Asynchronous FreshTags

Posted on

I have updated my version of FreshTags to include support for asynchronous loading of posts. Now if you add the following code to your template:

<script type=”text/javascript”>var freshtags_tag_format = “drop-add-async”;</script>

Instead of the drop-down box taking you over to the tags post page it will load the posts for the tag combination for you asynchronously in the sidebar.

A nice side-benefit of this is that you may now use all the other FreshTags tag-list types (except custom), including flat, flat-multi, list, list-multi, scroll, drop, and sub. Just put them in the above code where I have ‘drop-add-async’.

You will have to be using the jscripts.ning.com version of my FreshTags implementation for this to work, instead of the old one hosted on AWriterz. The code for the new include (which you can replace the old one with to upgrade) is:

<script type=”text/javascript” src=”http://jscripts.ning.com/get.php?xn_auth=no&amp;id=818185

FreshTags for WordPress

Posted on

The FreshTags system is more than just categories for Blogger. With the tag-passing features it adds a social aspect to blog browsing. Not everyone runs on Blogger, and some of us are lucky enough to run on blogging systems that support categories natively. The other FreshTags features would be and can be immensely useful to these people as well. So, in a move to push FreshTags beyond Blogger and beyond del.icio.us I have created a FreshTags plugin for WordPress.

Update: Version 0.11 has been released. Some minor bugs have been fixed and loading captured tags into the search box is now optional. To load the searchbox you must add this code to your template: <?php freshtags_load_searchbox(); ?>

Features

  • Detects tags passed directly via ?tags, ?tag, or ?cat
  • Detects tags from the referer URL, all the same formats as the original FreshTags are supported
  • Detects the tag of the current category page or the first tag on the current post, if applicable
  • Supports tag intersections
  • Displays n matching posts from detected tag(s) in the sidebar
  • Supports either list or drop form of tags in the sidebar, highlighting selected tag(s)
  • Rewrites post links when tags are selected to enable tag-passing from the blog
  • Generates JSON(P) feeds for use in peek-a-boo sidebar headlines by other blogs

Implementing
To implement this plugin on your WordPress blog:

  1. Download the plugin
  2. Unpack the file and upload ‘freshtags.php’ to your /wp-content/plugins/ directory on your blog
  3. Go to your WordPress dashboard and the plugins screen to activate the plugin
  4. Edit your template and replace the code that outputs the category list in your sidebar with:
    <?php echo freshtags_taglist();
           echo freshtags_postlist(); ?>

    To customise the display you can pass ‘drop’ to freshtags_taglist to get a drop-down list of tags. You can pass two parameters to freshtags_postlist, the first is the maximum number of posts to display (default: 10), the second is a string to output as a header for the list of matching posts (replacing %tags% with the detected tags, default none).

Other
I have updated my version of FreshTags to support getting peek-a-boo titles from blogs using this WordPress plugin. Just call load_otherblog_titles(‘wordpress’,’blog url‘,”,’feed url (optional)‘,’id of element to put results in‘); after the normal FreshTags data has loaded.