Page 1 of 1

News with Images/Thumbnails on listing page

Posted: Thu 5. Jan 2006, 14:32
by Stoffl
Hi,

i still try to understand how the different ways of image handling in phpwcms work together. I guess, it's best to avoid FSCKs image browser and rely on phpwcms file manager. Is this correct?

But let me explain my problem here first:

I want to create a news page. Some of the news articles can have images. So i use content type "Text with image" (Text mit Bild) for my news article. On the news summary (or listing) page, there should be a listing of all news articles. If the news article has an image, there should be a thumbnail of this image on the summary page.

Is this possible? I've already tried to create thumbnails, but could not get it to work. I use ImageMagick and it works on command line. I've seen that the according code is commented out in include/inc_tmpl/files.search.tmpl.php. So i suppose there's a better workaround for working with thumnails now.

I'm confused, any light? :)

Mike

Posted: Sat 7. Jan 2006, 15:04
by Stoffl
After doing some search i finally found out how to use templates with phpwcms. Unfortunately this isn't mentioned anywhere in the docs. Would be really useful for the more advanced user.

For the unaware: You can define templates in the /phpwcms_template/inc_cntpart folders. The templates you define there can be selected when creating a new article.

My problem now is that i have created a new template for my news listing and want to show a thumbnail automatically if there's a content part that uses images. (I don't want the user having to select the image twice - once for the summary thumbnail and once in the content part). I think about inserting some php code to the list template which should do the following:

- Look if we have some content part with image(s)
- Fetch the first used image from the associated content part
- Look if there's already a thumbnail for this image and create one if not
- Display this thumbnail in article listing

Maybe someone has some code hints for me. What would be the preferred way in phpwcms to get the required information? Anyway, the great resonance to my question makes me suppose i'm on my own on this one :)

Mike