serendipity_fetchPrintEntries, but no images

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

serendipity_fetchPrintEntries, but no images

Post by yellowled » Tue May 12, 2009 4:17 pm

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

YL
amazon Wishlist - Serendipity-Podcast (German only, sorry)

User avatar
Don Chambers
Regular
Posts: 3638
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: serendipity_fetchPrintEntries, but no images

Post by Don Chambers » Tue May 12, 2009 5:19 pm

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???

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

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
amazon Wishlist - Serendipity-Podcast (German only, sorry)

User avatar
Don Chambers
Regular
Posts: 3638
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: serendipity_fetchPrintEntries, but no images

Post by Don Chambers » Tue May 12, 2009 7:04 pm

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.

User avatar
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 » Wed May 13, 2009 4:42 pm

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

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

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
amazon Wishlist - Serendipity-Podcast (German only, sorry)

Post Reply