Best Dressed Mongrel

3rd June

2009

dogfashion.jpg

Animal fashion - it’s enough to make Terry Nutkins throw shapes in his grave (not that he’s dead, but he’s been off the telly so long he might as well be).

A day off every day

28th May

2009

Ferrishouse

Do you have $2.3m burning a hole in your pocket? Why not purchase 370 Beech Street, Ferris Beuller’s home in the eponymous film.

Nur nach Hause

20th May

2009

Frank-Zander

I finally had the privilege of witnessing the legend that is Frank Zander last Saturday before Hertha BSC’s final home match of the season against Schalke 04. The mulleted, moustachioed, über-ginger-wonder lead the crowd in a rousing rendition of Nur Nach Hause.

The Olympiastadion was heaving, easily the busiest I’ve seen it this season during the 9 matches I’ve been to:

Hertha BSC 1-1 Arminia Bielefeld
Hertha BSC 2-2 Wolfsburg
Hertha BSC 2-1 Stuttgart
Hertha BSC 1-0 Hoffenheim
Hertha BSC 2-1 Köln
Hertha BSC 2-1 Frankfurt
Hertha BSC 1-0 Bayer Leverkusen
Hertha BSC 2-0 Bochum
Hertha BSC 0-0 Schalke

That’s 9 of 17 home matches attended - not a bad return given that I live in south east London! Roll on next season where hopefully I can increase that number…

Pube template

20th May

2009

Pubes

My Slovenian brothers over at myBikini sell some jolly nice pubic beard shaving templates. The ideal gift for ‘er indoors, surely, unless she’s morbidly obese or Goodhew.

Bringing light to the world

10th May

2009

Lightbuldorder

Whilst tidying my desk, I chanced upon the despatch note from my last lightbulb order from BLT Direct. Now, don’t get me wrong, they’re jolly nice people, and they always have the annoying, can’t-buy-them-anywhere bulbs that our office is littered with. However, they failed to comply with my ESSENTIAL delivery instructions (see scan for details). Honestly, is a little choreographed dance routine really too much to ask?

We are 3

24th April

2009

Birthday

It’s Include’s 3rd birthday today. My nan’s too (she’s 79). Fee free to post us gifts, money, pornography, darts paraphernalia - we’re happy to receive pretty much anything. Don’t post porn to my nan, though, she’s not a fan. She likes biscuits, you see.

Deanna Halsall

23rd April

2009

Deannahalsall

Illustrator Deanna Halsall has a charming website that showcases her quirky illustrations perfectly.

What’s for dinner, Riki?

17th April

2009

Doughnuts

Artist Riki Takaoka sketches and paints the things he eats.

Smarty SEO plugin: meta_tag

3rd April

2009

Carolv

Presenting the meta_tag plugin for the Smarty templating engine!

Click here to download block.meta_tag.txt

Click here to download outputfilter.meta_tag.txt

This plugin allows you to change the page title and meta tags from any template used to generate page output.

Purpose

Typical web page display scenario:

Web page “Home” consists of Smarty templates:

  • header.tpl - generic page header, HTML declaration, <HEAD> & <BODY> tags etc.
  • navigation.tpl - site navigation.
  • home.tpl - the main content for a given page, in this example “home”.
  • footer.tpl - the page footer - closing </HEAD> & </BODY> tags, javascript tracking etc.

In this example, the page title and meta data would be in header.tpl, whether as Smarty variables:

<title>{$page_title}</title>

…or hard-coded values:

<title>Hello world!</title>

Using the meta_tag plugin, title and meta tag values can be updated from any other template used to generate the page.

The following example contained in footer.tpl would add “Product description” to the page title:

{meta_tag type=’title’ method=’add’}Product description{/meta_tag}

The following example contained in home.tpl would replace the page title with the text “Important business report”:

{meta_tag type=’title’ method=’replace’}Important business report{/meta_tag}

The following example contained in footer.tpl would add the text “jacket,blue,leather” to the meta keywords:

{meta_tag type=’keywords’ method=’add’}jacket,blue,leather{/meta_tag}

So… what’s the point?

Often when you’re displaying dynamic data across several templates it isn’t practical to customise the page title and meta information using Smarty assign(). Also,the logic used in templates processed after the page header might contain information which would be useful to reference in the header.

Caveat

It’s preferable to call load_filter just once per output, BEFORE the instruction to display() or fetch():

$smarty->load_filter(’output’, ‘meta_tag’);
$smarty->display(”template.tpl”);

In a scenario where multiple templates are used, they should all be contained within one container template, to ensure the output filter isn’t called repeatedly. In the above example, template.tpl might be:

{include file=’generic/header.tpl}
{include file=’generic/navigation.tpl}

{* load main page body - filename is contained within var $template*}
{include file=’`$template`}
{include file=’generic/footer.tpl}

Installation:

Click here to download block.meta_tag.txt

Click here to download outputfilter.meta_tag.txt

Change the file extension on both files to .php, then copy them to your Smarty plugins directory (smarty/plugins). Detailed usage instructions can be found in the comment block of each file.