Page 1 of 1

Condensed view on frontpage?

Posted: Tue Feb 28, 2006 4:02 pm
by sir17
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.

Re: Condensed view on frontpage?

Posted: Tue Feb 28, 2006 5:57 pm
by garvinhicking
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

Posted: Tue Feb 28, 2006 6:05 pm
by carl_galloway
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.

thanks

Posted: Thu Mar 02, 2006 9:39 pm
by sir17
that's a great starting point, thanks