The Serendipity Handbook

You can now read the (german) handbook here: PDF - https://github.com/s9y/Book (LaTeX source).

Forum-Information

Before posting about errors, make sure that the answer cannot already be found in our FAQ or by searching this forum!
Posting is restricted to registered users (registering is free and simple!) due to recent spam attacks. When having trouble with this board, contact garvin(-at)s9y(-dot)org.

Board index Themes Different designs for sidebar blocks

Skinning and designing Serendipity (CSS, HTML, Smarty)
LazyBadger
Regular
 
Posts: 173
Joined: Mon Aug 25, 2008 12:25 pm
Location: Russia

Postby LazyBadger » Tue May 17, 2011 6:13 pm

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?

User avatar
Don Chambers
Regular
 
Posts: 3077
Joined: Mon Feb 13, 2006 3:40 am
Location: Chicago, IL, USA

Postby Don Chambers » Tue May 17, 2011 6:27 pm

In templates/default/index.tpl, you can see an example 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>


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
{serendipity_printSidebar side="right" template="my_unique_sidebar.tpl"}



Return to Themes

Who is online

Users browsing this forum: Google [Bot] and 0 guests