Page 1 of 1

How to determine latest posting?

Posted: Wed Nov 08, 2006 2:35 am
by MarcusJ.
Hi,

I'm completely new to Serendipity and Smarty (and this forum - please have patience ;-).

But nonetheless I jumped into the cold water and just started to port the Emire theme from WordPress (http://ifelse.co.uk/emire/).

But now I'm a little stuck because of lack of knowledge of Serendipity's internals.

So far I managed to number the articles of a dategroup by means of some foreach constructs to style them differently on a page.
I also managed to hack together a plugin to construct a suckerfish menu from static pages by picking up some code in this forum and abusing the static pages sidebar plugin - still needs some nice styling but alas it works for me.

(You can see my progress so far at http://www.bogomips.de/s9y/)

But I up till now found no hint of how to determine whether an article to display is the very latest of the blog. I just want to style the very latest posting differently as the original Emire theme does.

Any ideas?

Posted: Wed Nov 08, 2006 3:16 am
by carl_galloway
Hi Marcus,

Welcome to Serendipity!!!

Getting the latest entry is easily done, follow the example in this tutorial, and you should be able to do everything you want.

The emire theme looks like a beauty, will you be making it available for other users to download as well, please, I'm sure you'll have quite a few loyal fans if you do...

Carl

Posted: Wed Nov 08, 2006 9:29 am
by garvinhicking
Hi Marcus!

Since Carl perfectly answered your question, I can only chime in: Welcome to Serendipity.

I admire the work and effort you put into your blog - it shows! You really achieved something great in the quick learning curve. Once you get a hang of Smarty, it really is very powerful and flexible and nicer to read than pure PHP templates (which, BTW, serendipity can also emulate if you just want to use PHP - but, different story).

I really enjoy your template port and would love to see if you could contribute the theme to Spartacus? Did you, BTW, have a look at all our Spartacus templates, or did you only look at the bundled ones?

Keep it up! :-)

Best regards,
Garvin

Posted: Thu Nov 09, 2006 4:36 am
by MarcusJ.
Thank you very much for your nice welcome and your help!

I tried it the way Carl pointed me to and it works very well.

I have to admit making this theme so far was not very creative since the styling in general is from the wordpress theme and the majority of the code I actually picked up mostly from postings from both of you in this forum here. So naturally I planed making this theme available for others, too.

You find my current and somewhat unfinished version of the theme here
(http://www.bogomips.de/s9y/index.php?ar ... -port.html
although the menus still look quite ugly :oops:
Maybe you shouldn't look too deep into the code because much of it comes more from trial-and-error than actual knowledge :wink:

I'm not sure this is ready for spartacus, yet. Especially the plugin-hack is quite ugly and needs an admin to set the plugin to status hidden manually within the plugin administration.
Speaking of which: How does one check from within index.tpl whether a plugin is installed or not? This way I could at least activate code for a normal manually maintained menu if the plugin isn't installed and deactivate the javascript portion.

I definitely need some more time to get more insight into the internals of serendipity myself and I really need to look more into some of the other themes how they are doing some stuff.

BTW: How does one contribute a theme to spartacus?

Posted: Thu Nov 09, 2006 5:52 am
by carl_galloway
Checking to see if a plugin is installed, read this thread

As for getting a template into spartacus, either let garvin know that its complete by posting a new thread in the themes forum, or request cvs access.

Don't worry about whether your template is ready for spartacus, if you think its ready to be tested by other users then just post it here, quite a few of us will probably download it and if there are any glaring problems you'll have more bugs reports and possibly fixes than you can handle.

Carl

Posted: Thu Nov 09, 2006 11:23 am
by d_cee
Hi marcus

another welcome!
really nice job with the template so far! - and I don't find the menus ugly. I'll look forward to seeing the finished port.

Dave