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.
Condensed view on frontpage?
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Condensed view on frontpage?
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
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/
# 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/
-
- Regular
- Posts: 1331
- Joined: Sun Dec 04, 2005 5:43 pm
- Location: Andalucia, Spain
- Contact:
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,
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.
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}
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
that's a great starting point, thanks