Navigation Search Other Links

TN38 proudly recommends cheap website hosting for small businesses at Pacifica Hosting. Visit UK website hosting for more information.

For web marketing training, presentations and workshops visit Pacifica Training. If you wish to ask questions about website marketing please head over and register free at the website marketing forum, a knowledge base and community driven discussion group.

Movable Type Digg Tag

I wanted a plugin for Movable Type, which is the tool that runs this website, that allowed me to add a Digg link at the foot of every post. There's one at Majordojo but it doesn't validate and comes with a load of other stuff which I really didn't need. Since it needed to be hacked to validate I may as well write my own that does the job I want it to.

A semantic, validated Movable Type tag that adds a Digg link to your blog.

To install and run, follow the instructions below:

  1. Download the script at http://blog.tn38.net/dev/diggit/DiggIt.pl

  2. Upload the script to your plugins directory.

  3. Open the individual archives template or whichever template powers your posts.

  4. Add the following code where appropriate:

    <p>Useful? Then <a href="<$MTDiggIt$>">Digg It</a>.</p>

    The output will be:

    Useful? Then <a href="**correctly encoded url**" rel="external">Digg It</a>.
  5. Rebuild archives if necessary then validate.

Useful?

Assistance?

Comments

Byrne Reese says:

FYI - Promote This! has been updated to encode URL's properly.

Of course encoding ampersands as you have done is only "valid" for some HTML schemas, not all of them.

Ed says:

Thanks for the info Byrne.

As for validation, you're right it isn't necessary to encode ampersands for all DOCTYPEs, only those that matter, i.e. Strict but it certainly doesn't fail validation when encoded correctly so is deemed best practice.

vijay says:

Thanks for the plugin. It works like a charm.

Michael Heraghty says:

Thanks for this Ed, but I had the same problem as I had when trying to install PromoteThis - a Smarty error - unrecognized tag 'MTDiggIt'.

My knowledge of things like Smarty is dim. Any suggestions?

Ed says:

Michael, is the plugin installed correctly in:
Main Menu > System Overview > Plugins

If so, then all should be well but I've heard elsewhere that there are Smarty errors with some plugins when the build is dynamic. When it's a static build everything is fine. Smarty site is down right now so I can't get to investigate it yet but I'll have a look into it to see what it could be.

Michael Heraghty says:

Ed, thanks for the response. Yes, the System Overview > Plugins screen tells me that it is correctly installed.

I have my blog set to build dynamically so, yeah, I guess this is the problem. If you find a workaround, be sure to let me know, thanks.

Assistance?

Post a comment

To reproduce, read the Copyright Notice
Published by Edward Clarke
Powered by Movable Type