Smarty in your s9y sidebar

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 🙂

One thought on “Smarty in your s9y sidebar

  1. 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

Leave a Reply

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