Page 1 of 1

Align sidebars titles

Posted: Thu Nov 08, 2007 11:08 pm
by Janine
Hi,

Im using Serendipity with the theme 'idea'. This uses the file sidebar.tpl from the templates\default folder. This file says:

Code: Select all

{if $is_raw_mode}
<div id="serendipity{$pluginside}SideBar">
{/if}
{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}
{if $is_raw_mode}
</div>
{/if}
The style for the Title looks for: serendipitySideBarTitle. This item is used for the left and rightside. I would like to align the text for the rightside different then for the leftside. How can I separate this?

I think the requires a change to sidebar.tpl (which I dont know) and the .css of the theme 'idea'. I thought about changing the class for the leftside into serendipitySideBarleftTitle and the rightside serendipitySideBarrightTitle.

Please help me with spliting the the layout of the sidebars into left and right.

Thank you,
Janine Ringers

Posted: Fri Nov 09, 2007 2:18 am
by Don Chambers
You do not need to modify the sidebar.tpl file. You can already uniquely identify each sidebar title.

The style.css file contains this:

Code: Select all

#serendipityRightSideBar * .serendipitySideBarTitle {
  border-left: 1px #666 dashed;
}

#serendipityLeftSideBar * .serendipitySideBarTitle {
  border-right: 1px #666 dashed;
}
I'm not entirely sure what the asterisk is doing in there.

Anyway, you could add rules for whatever sort of alignment you want. For instance, if you wanted the right sidebar titles aligned right, and the left sidebar titles aligned left, you could do this to the code:

Code: Select all

#serendipityRightSideBar .serendipitySideBarTitle {
  border-left: 1px #666 dashed;
  text-align: right;
}

#serendipityLeftSideBar .serendipitySideBarTitle {
  border-right: 1px #666 dashed;
  text-align: left;
}

Yep

Posted: Fri Nov 09, 2007 11:32 am
by Janine
Yes it works!

Thank you!

Re: Yep

Posted: Sun Nov 11, 2007 3:26 am
by Don Chambers
Janine wrote:Yes it works!

Thank you!
Happy it worked out!!