Smarty in your s9y sidebar

June 28th, 2007

I recently discovered the "markup: smarty" event plugin in spartacus! It allows you to add smarty tags in your entries and sidebar html nuggets. I installed it and am using smarty tags within an HTML nugget sidebar plugin to selectively display links in the sidebar.

Some of the links are supposed to display sitewide while others are homepage only. Using smarty in the HTML nugget allows me to display them correctly:



<!-- sitewide links -->
<a href="http://example.com">Sitewide 1</a><br />
<a href="http://example.com/">Sitewide 2</a><br />
<!-- frontpage only links -->
{if $startpage}
<a href="http://example.com">Frontpage only 1</a><br />
<a href="http://example.com/">Frontpage only 2</a><br />
{/if}

If I have added hijri date support for a theme I can display that as well:

<div class="hdate">{hdate tstamp=$smarty.now format='*hj:d F Y'}</div>

I am sure there are other nifty things you can do with this smartification plugin :)

Related posts:

One Response to “Smarty in your s9y sidebar”

  1. Nur ein Blog says:

    Abdussamad hat mit "Smarty in your Sidebar" wieder einen interessanten Artikel rund um Serendipity/S9y geschrieben. Darin beschreibt er wie man mit dem "markup: smarty" event plugin Linklisten so gestalten, dass z.B. nur auf der Starts

    Posted on 28 Jun 2007 Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">