serendipity_fetchPrintEntries, but no images

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

serendipity_fetchPrintEntries, but no images

Post by yellowled »

Just wondering: Is there a way to serendipity_fetchPrintEntries without images potentially included in those entries, but keeping the markup intact?

YL
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: serendipity_fetchPrintEntries, but no images

Post by Don Chambers »

I cannot see an easy way to do that. you can strip all html from the entry, but that does not seem to be what you want. You could search the entry for image code then strip (or replace) only that code, but that is problematic too because an image might begin with <img>, but if it has comments, it would begin with a <div class="serendipity_imageComment">....

How about the lazy route - make sure images are only used in the extended body, then fetch only the entry body???
=Don=
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: serendipity_fetchPrintEntries, but no images

Post by yellowled »

Don Chambers wrote:I cannot see an easy way to do that.
*sigh* I was assuming that, but I thought I'd ask anyway.
Don Chambers wrote:you can strip all html from the entry, but that does not seem to be what you want.
Jeez, no.
Don Chambers wrote:How about the lazy route - make sure images are only used in the extended body, then fetch only the entry body???
Yeah, well, I got five words for you: Multiuser blog plus wysiwyg editor. (In other words, prone for error. It's not the best solution I can think of theoretically, but probably the only one existing.)

YL
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: serendipity_fetchPrintEntries, but no images

Post by Don Chambers »

yellowled wrote:Yeah, well, I got five words for you: Multiuser blog plus wysiwyg editor. (In other words, prone for error.....)

YL
Definitely a worst-case scenario, especially if the images need to be part of the entry, and are not contained within an extended property field.
=Don=
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Re: serendipity_fetchPrintEntries, but no images

Post by judebert »

Perhaps you could suppress the image with CSS? It would still be fetched, just never displayed. Something like:

Code: Select all

.serendipity_entry_body img {
  display:none;
}
Of course, if you still need the images in the single-entry view, you'd have to include that CSS through your template, checking the $view variable.
Judebert
---
Website | Wishlist | PayPal
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: serendipity_fetchPrintEntries, but no images

Post by yellowled »

judebert wrote:Perhaps you could suppress the image with CSS?
Hmmmmm ... :)
judebert wrote:Of course, if you still need the images in the single-entry view, you'd have to include that CSS through your template, checking the $view variable.
Yes, I do -- but that shouldn't be difficult here since this template has a Mimbo-ish start page anyway :)

I'll have to check it out in detail, but this sounds promising. Thanks for the input, Jude! :)

YL
Post Reply