Hello, a beginner here with a not strictly theme related question but this seemed the best place to post my issue.

I'm developing my first Drupal website and having some layout issues.

I'm using Views to select nodes and organize them in blocks like so:

Style: Grid (2 columns)
Row Style: Node (Teaser)

The view selects two latest nodes from the Article (custom) content category. The block is then placed in the Content area and is being displayed on front page only.

For image handling I chose the most idiot-proof module I could find which is imagepicker (very easy to upload and insert images into posts). Images are auto-resized to 400px and look just fine in the full node view. The problem occurs when they get displayed in the View block.

Two columns - two images of 400px each on a 960 width theme = disaster.

Now, I've already figured out I can preprocess the view and use PHP to alter image paths for the block to point them to thumbs (imagepicker generates these automatically) but I'm wondering if there's a more elegant solution to this?

Comments

JohnWoltman’s picture

I don't know if ImagePicker can integrate with ImageCache, but Views can use any ImageCache style (like thumbnails) in its display of an image. It is very handy for things like you're doing.

vladanr’s picture

I am starting to lean towards imagecache/insert/imageapi/imagemagick combination as well. However, according to this:

http://drupal.org/node/902096

You still need to do some PHP editing in order to make it work. Or is the document outdated and imagecache and views are more tightly integrated now?

vladanr’s picture

I've added and configured the following:

Insert
ImageMagick
ImageApi
ImageCache

Working like clockwork, created a preset in imagecache, inserted a pic with no problems, got resized properly and everything, configured the image field added to my node to exclude the original file and to display imagecache full_size (400px max) in Full Node, thumb_size (100px max) in teaser...

Now the article isn't displaying a teaser at all, no text, no pics, nothing :|

vladanr’s picture

Belay that, the link apparently exceeded my teaser length. I'm guessing it got truncated in the middle of the link and caused an error so nothing was being displayed. I should probably raise this issue somewhere else, sounds pretty serious.

FieldImage display controls have no effect on inserted images, just trailing images (which I prefer to keep hidden).

So I'm back to square one, which is modifying the view with a php template that will search/replace HTML node content. Now that I'm using imagecache I'm guessing all I need to do is switch imagecache presets and I should be set to go, right?

JohnWoltman’s picture

I know that I wrote a little PHP when I did the views, but I thought that Views/ImageCache took care of most of the work. When I get home I will review my site and tell you the exact combination I used.

vladanr’s picture

I suppose another way to go about this is to change the Row Style in View property to "Fields" and then select the smaller image preset by imagecache as one of the fields (yes, this works fine), assign a CSS class to the view and then format the view using a css stylesheet.

However, I really like the styling my base theme is applying to teasers and I'm having trouble replicating it in a custom stylesheet. I also like the random positioning of pics which happens when users insert their pics (some will be aligned right, some left, and in different places in the text), which I can't (perhaps due to lack of knowledge) replicate with CSS.

So, custom css or custom php? I'd appreciate some pros and cons...

vladanr’s picture

I believe this is the module I've been looking for:

http://drupal.org/project/contemplate

Haven't implemented it yet but will post results when/if I finally solve the issue of image handling.

vladanr’s picture

Finally solved it:

http://drupal.org/project/teaserthumbnail

Previous module is useful but not for this issue.

JohnWoltman’s picture

And I'm glad you found teaserthumbnail! I didn't know about this module, it sounds useful.