Page 1 of 1
Changing Plugins depending on themes
Posted: Thu Mar 30, 2006 10:29 am
by Ianardo
Is it possible to have a plugin appear only in a specific theme?
In the example below (Keyline_2) the menu is shown as tabs in the top section but when you switch themes (to Keyline) you don't have a menu.
I want to add an html nugget with a menu in it but I don't want it to appear on the first theme.
http://keylinelicensing.toondesign.biz/lobby/]Example
Any suggestions?
Cheers
Ian
Re: Changing Plugins depending on themes
Posted: Thu Mar 30, 2006 12:53 pm
by garvinhicking
Yes, you can do that.
For that you need to put a sidebar.tpl into the theme that should not show the sidebar plugin. You will see this code in it (excerpt):
Code: Select all
{foreach from=$plugindata item=item}
<div class="serendipitySideBarItem container_{$item.class}">
{if $item.title != ""}<h3 class="serendipitySideBarTitle {$item.class}">{$item.title}</h3>{/if}
<div class="serendipitySideBarContent">{$item.content}</div>
</div>
{/foreach}
Now you can modify that to skip the HTML nugget:
Code: Select all
{foreach from=$plugindata item=item}
{if $item.title != 'Menu Nugget'}
<div class="serendipitySideBarItem container_{$item.class}">
{if $item.title != ""}<h3 class="serendipitySideBarTitle {$item.class}">{$item.title}</h3>{/if}
<div class="serendipitySideBarContent">{$item.content}</div>
</div>
{/if}
{/foreach}
See the IF statement I wrapped around the output? This will prevent showing the nugget with the title "Menu Nugget" in your theme.
HTH,
Garvin
Posted: Thu Mar 30, 2006 1:46 pm
by Ianardo
Fantastic - i'll try that later
---Later---
Wonderful. Thank you so much.