Content last modified Monday 6 March 2017
hop to #bottom
Categories:
Author:
Current version:
0.4
About It:
Get it:
Rate it:
  • Helpful?
  • 0 Yes
  • 0 No
Flag it:
Contact Reason [ ? ]

mcw_ma_gnolia

mcw_ma_gnolia is a TextPattern plugin that generates a customizable Ma.gnolia link roll for use on your website. Download it now, and start playing!

What is it?

Ma.gnolia is a social bookmarking site (somewhat like del.icio.us) that I use to keep track of interesting websites I come across. It provides the built in ability to display your most recent bookmarks on your personal website (a ‘link roll’), but I don’t like the mechanism it uses to make that happen.

Ma.gnolia provides you with a JavaScript file that uses document.write to dump the link roll to your site. This works, but it’s not exactly accessible, nor is it very flexible. mcw_ma_gnolia leverages this built-in mechanism to provide what I hope is an extremely flexible and accessible link roll without the use of client-side JavaScript.

In a nutshell, the plugin downloads and caches the JavaScript file server-side on a quasi-hourly basis, extracts the link information, and makes the data available for you via a series of TextPattern tags that you can use in your forms and pages.

How Do I Use mcw_ma_gnolia? (e.g. quickstart)

Start by downloading the plugin and installing it like you would any other. Once you’ve gotten the plugin installed, edit it, and enter your ma.gnolia username and the number of links you’d like displayed into the public config section of the PHP code (should be lines 6 and 7 or so). If you don’t do this, you’ll be seeing my links. That’s a fine way to test, but you’ll probably want to make this change before you go live.

Next, click on the extensions tab, and then on the Ma.gnolia Linkroll subtab. Hitting this page will automatically create a form called mcw_ma_gnolia, and offer you the opportunity to force-update your cached ma.gnolia links. Go ahead and hit that button now to speed things up later.

Finally, edit a page to include the <txp:mcw_ma_gnolia /> tag. Viola, ma.gnolia links on your page. Astounding!

How do I configure the output?

Excellent question. Here’s brief documentation of each of the tags this plugin enables:

  • txp:mcw_ma_gnolia — The mcw_ma_gnolia tag is a single tag that gets replaced with the Link Roll. It can be included on a page directly, or as part of a form that’s displayed on a page. It has several attributes:
    • form — this specifies the form to be used for each of the displayed links. Defaults to mcw_ma_gnolia.
    • wrap_tag — specifies the block-level tag to wrap the links. Defaults to ul.
    • class — applies a CSS class to the block-level tag specified in the wrap_tag attribute.
  • txp:mcw_ma_gnolia_uri — The mcw_ma_gnolia_uri tag is a single tag that gets replaced with a link’s URI (the actual address of the link).
  • txp:mcw_ma_gnolia_link — The mcw_ma_gnolia_link tag is a single tag that gets replaced with a link’s ma.gnolia redirect (e.g. http://ma.gnolia.com/bookmarks/bupuxeseq/dispatch)
  • txp:mcw_ma_gnolia_title — The mcw_ma_gnolia_title tag is a single tag that gets replaced with a link’s title.
  • txp:mcw_ma_gnolia_desc — The mcw_ma_gnolia_desc tag is a single tag that gets replaced with a link’s description.

Example page:

Page: default

...
    <div id='ma_gnolia_linkroll'>
        <h2>My Recent Bookmarks</h2>
        <txp:mcw_ma_gnolia
            form='mcw_ma_gnolia'
            wrap_tag='ol'
            class='ma_gnolia_list'
        />

    </div>
...

Example form:

Form: mcw_ma_gnolia

<li>
    <a 
        href='<txp:mcw_ma_gnolia_link />'
        title='<txp:mcw_ma_gnolia_title />'
    ><txp:mcw_ma_gnolia_title /></a> - <txp:mcw_ma_gnolia_desc />

</li>

Would produce:

<div id='ma_gnolia_linkroll'>
    <h2>My Recent Bookmarks</h2>
    <ol class='ma_gnolia_list'>

        <li>
            <a 
                href='LINK_GO_HERE'
                title='TITLE_GO_HERE'
            >TITLE_GO_HERE</a> - DESCRIPTION GO HERE
        </li>
        ...
        <li>
            <a 
                href='LINK_GO_HERE'
                title='TITLE_GO_HERE'
            >TITLE_GO_HERE</a> - DESCRIPTION GO HERE
        </li>

    </ol>
</div>

Nice, eh?

Article Request Count:
Initially released:
23. April, 2006
Posted here:
17 Jun 2006
Article modified:
20 Apr 2012

If there is a comment form at the Information URL, you may want to leave your comments/questions there or at the Forum thread for quicker feedback. Otherwise, comment away:

Your comment will NOT be submitted until you click the 'Submit' button on the next pageload.

Subscribe to this article's comments RSS feed. [ ? ]   View Recent Comments across the site.

You know you want to visit the Archives.

Browse

Categories


Articles

There are also tag clouds, 'cause those are fun.
Published with Textpattern