Align sidebars titles

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
Janine
Regular
Posts: 13
Joined: Tue Apr 03, 2007 8:48 am

Align sidebars titles

Post 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
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post 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;
}
=Don=
Janine
Regular
Posts: 13
Joined: Tue Apr 03, 2007 8:48 am

Yep

Post by Janine »

Yes it works!

Thank you!
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Yep

Post by Don Chambers »

Janine wrote:Yes it works!

Thank you!
Happy it worked out!!
=Don=
Post Reply