Page 1 of 1

serendipity_fetchPrintEntries, but no images

Posted: Tue May 12, 2009 4:17 pm
by yellowled
Just wondering: Is there a way to serendipity_fetchPrintEntries without images potentially included in those entries, but keeping the markup intact?

YL

Re: serendipity_fetchPrintEntries, but no images

Posted: Tue May 12, 2009 5:19 pm
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???

Re: serendipity_fetchPrintEntries, but no images

Posted: Tue May 12, 2009 5:42 pm
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

Re: serendipity_fetchPrintEntries, but no images

Posted: Tue May 12, 2009 7:04 pm
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.

Re: serendipity_fetchPrintEntries, but no images

Posted: Wed May 13, 2009 4:42 pm
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.

Re: serendipity_fetchPrintEntries, but no images

Posted: Wed May 13, 2009 11:14 pm
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