Condensed view on frontpage?

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
sir17
Regular
Posts: 8
Joined: Tue Feb 28, 2006 2:55 pm
Contact:

Condensed view on frontpage?

Post by sir17 » Tue Feb 28, 2006 4:02 pm

Well, it's me again...
I would like to have a condensed view for all the entries displayed on the frontpage, cut of after three lines or so, with a read more link to the full article. I tried the split page plugin, but it didn't work - not sure if this would be the right approach anyway. Any quick thoughts on how to implement that best, could I reuse some code of that split page plugin?
Thanks a lot.

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Condensed view on frontpage?

Post by garvinhicking » Tue Feb 28, 2006 5:57 pm

When you create an entry, you have the possibility to split up an entry into a "Entry Body" and an "Extended Entry". The Entry Body will always be shown on the frontpage, but the Extended Entry will be shown only on "full article view". So this should be what you're looking for!? :-)

Best 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/

carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway » Tue Feb 28, 2006 6:05 pm

I'm trying to do a similar thing for the archives page, and would also love this for search results. What I've tried, which does work in Serendipity version one, although it has problems is this;

In your entries.tpl, place an {if} statement where you want the summary,

Code: Select all

{if not $startpage}
{$entry.body}
{else}
{$entry.body|truncate:400}
{/if}


The smarty site lists some other options. This page isn't as detailed as it should be, so download the documentation, there is a bit more in it.

Now the downside, if the entry is saved with an image or other html code, smarty counts this toward your truncate number, so this is where I'm having trouble at the moment, and the smarty documentation isn't written for theme designers, its written for programmers - stupid considering its a templating language but there you go.

sir17
Regular
Posts: 8
Joined: Tue Feb 28, 2006 2:55 pm
Contact:

thanks

Post by sir17 » Thu Mar 02, 2006 9:39 pm

that's a great starting point, thanks

Post Reply