Different designs for sidebar blocks
-
- Regular
- Posts: 176
- Joined: Mon Aug 25, 2008 12:25 pm
- Location: Russia
- Contact:
Different designs for sidebar blocks
Are there any way to detect in which sidebar block must be output'ed (inside theme)? For strange reason I want to get differently decorated blocks in left and right sidebar, but - see only one sidebar.tpl
Quis custodiet ipsos custodes?
-
- Regular
- Posts: 3652
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Re: Different designs for sidebar blocks
In templates/default/index.tpl, you can see an example like this:
So, using css, you can style each sidebar differently with #serendipityLeftSideBar, and #serendipityRightSideBar....
Each of the above will use sidebar.tpl from your template, if it exists, or /templates/default/sidebar.tpl if it does not.
If you want to call a unique smarty tpl, you can do that like this:
Code: Select all
<table id="mainpane">
<tr>
{if $leftSidebarElements > 0}
<td id="serendipityLeftSideBar" valign="top">{serendipity_printSidebar side="left"}</td>
{/if}
<td id="content" valign="top">{$CONTENT}</td>
{if $rightSidebarElements > 0}
<td id="serendipityRightSideBar" valign="top">{serendipity_printSidebar side="right"}</td>
{/if}
</tr>
</table>
Each of the above will use sidebar.tpl from your template, if it exists, or /templates/default/sidebar.tpl if it does not.
If you want to call a unique smarty tpl, you can do that like this:
Code: Select all
{serendipity_printSidebar side="right" template="my_unique_sidebar.tpl"}
=Don=