Change Category List and Calendar Layout

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Collectonian
Regular
Posts: 17
Joined: Thu Nov 04, 2004 10:54 pm
Location: Bryan-College Station, TX
Contact:

Change Category List and Calendar Layout

Post by Collectonian »

I want to change the way categories look in the side bar. Instead of just being a list straight down, I want it to look like:

[ cat1 | cat2 | cat3 ]

I can't figure out which file I need to edit to do that in, though, or is it possible to do at all?

Also, I'd like to change the calendar to use either 1 or 2 letter abbreviations instead of 3 for the days of the week. Where can I do this at?

As an add on, are there any other image options we have for the "Powered by Seredipity" icon? Something using the current icon colors would rock since it goes more with my site's look. :D
JWalker
Regular
Posts: 177
Joined: Mon Sep 12, 2005 4:14 pm
Location: Botevgrad, Bulgaria
Contact:

Re: Change Category List and Calendar Layout

Post by JWalker »

Collectonian wrote:Also, I'd like to change the calendar to use either 1 or 2 letter abbreviations instead of 3 for the days of the week. Where can I do this at?
I use Bulgarian language and the names of the weekdays are very long, i.e. for Monday the name is 10 letters so the calendar does not have a good look. The file that deals with the calendar is 'D:\biz\apps\serendipity\include\plugin_internal.inc.php' and I think that the code that generates day names is at lines 300-304:

Code: Select all

        $dow = array();
        for ($i = 1; $i <= 7; $i++) {
            $dow[] = array('date' => mktime(0, 0, 0, 3, $bow + $i - 1, 2004));
        }
        $serendipity['smarty']->assign('plugin_calendar_dow', $dow);
I think about this too and if create something useful will post it here.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Change Category List and Calendar Layout

Post by garvinhicking »

Hi!
Collectonian wrote:I want to change the way categories look in the side bar. Instead of just being a list straight down, I want it to look like:

[ cat1 | cat2 | cat3 ]

I can't figure out which file I need to edit to do that in, though, or is it possible to do at all?
Actually the bundled sidebar plugins are not very easily modificable because of performance issues. So they are not smarty-customizable.

The easiest way would be to make this change via CSS. You can change the display: block to display:inline of those elements, they are accessible via CSS IDs as you can see in the HTML output of your page.

If CSS is too hard for you and you prefer PHP, you can edit the PHP file and edit the HTML output easily by looking at your file include/plugins_internal.inc.php, the class is called "serendipity_categories_plugin". Either edit this file straight ahead, or copy the whole class inside a new external plugin file with your own custom name and edit that plugin. Then you'd have your own plugin and can update serendipity without the need to mess with the files.
Also, I'd like to change the calendar to use either 1 or 2 letter abbreviations instead of 3 for the days of the week. Where can I do this at?
That is changed by editing your template file "plugin_calendar.tpl". Lookout for this codE:

Code: Select all

{$dow.date|@formatTime:"%a":false}
and change it to:

Code: Select all

{$dow.date|@formatTime:"%a":false|@truncate:2:'':true}
As an add on, are there any other image options we have for the "Powered by Seredipity" icon? Something using the current icon colors would rock since it goes more with my site's look. :D
I think some users have made special icons for this, maybe you can search the forums?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply