where to truncate?

Mike Lyda mike at lyda.us
Tue Jun 6 22:30:59 EST 2006



At 02:46 AM 6/6/2006, you wrote:
>Op ma, 05-06-2006 te 22:58 -0400, schreef Mike Lyda:
> > So how do I truncate their giant entries down to a nice summary like
> > this:  http://fullasagoog.com/  and how can I force their images to
> > display at a certain (maxsize=180) size so the images don't take over?
>
>As far as I know, you can't. All you can do is use CSS to set the
>maximum width/height, but this has no effect on the original image,
>which after all is on the owner's server.
I think that'll work..  just as long as I have some way of keeping a 
2300x1400 image from wrecking the layout... the user will still have to 
download the huge file though.
And/Or.. It seems like it would be possible to look at the img elements in 
the content and check their width and height attributes and if they're too 
large then remove the img element entirely (so the user doesn't have to 
download a 420k jpg file)



> > Or.. can I check for a summary and if one exists then use it.. and if not
> > then truncate the content down to say 60 words?
>
>You can like this in your template:
><TMPL_IF summary>
>         <TMPL_VAR summary>
><TMPL_ELSE>
>         <TMPL_VAR content>
></TMPL_IF>
>
>If there's a summary, it will use that, otherwise it will use the full
>content of the feed.
that's great, but still no way to truncate it down to 60 or 90 words 
though..   :(



More information about the devel mailing list