Views tips and recipes for image module

This page contains various tips, tricks, and recipes for doing stuff with the views support in the image package. Please add your own!

Display Only Nodes with Attached Images by Using Relationships

The Image Attach module allows the creator of a View to limit the display to only those nodes which have an image attached to them. In Drupal 5/Views 1, this was accomplished via a filter; in Drupal 6/Views 2, it is done via a Relationship.

  1. In the Views edit screen, click the plus sign next to Relationships to add a new relationship.
  2. Under Defaults: Add relationships, check the box for Image attach: Attached image nodes.
  3. Click add.
  4. Under Defaults: Configure Relationship Image attach: Attached image nodes, check the box for Require this relationship.
  5. Click Update.
  6. Click Save to save your View.

The resulting View will display only nodes that have attached images.

Finding 'orphaned' images

If you use images only with image attach, you may want to 'clean up' image nodes that are no longer attached to a node.
A view of image nodes with the following will show you only image nodes that don't have an attaching node:

Drupal 6 - Front page simple slide show with Views 2 and a few lines of javascript

This really is not that hard and I still do not see a module that does this simple.
Jcarousel might.

But all I want is ONE image at a time.
Made from a view and cck.

I want the client to make a node in this case called Front Page Image and they just attach the CCK image.

For that I also used Image Cache.

Here are the steps.
Needed Modules
Image Cache, Imagefield (cck), Views

1. Image cache
Add a preset. For me I just put resize and that was it.
With Imagecache I setup a predefined scaled image so no matter what they upload it fits well.

2. The Node.
Create a new node type then add a cck filefield Image.
After you save this I set the display to this as well but not really sure if that is needed.

3. Make the view.
Then I made a very simple view. I would attach it but it is so easy I will explain it so you can bend it to your needs.
--Make the view and add a page.
--Add a field which will be the name of the CCK field you did above
--Filter on Published
--Sort as needed.
--Show say 10
--Give it a path or just use default.

Done
Now with a Home page view views or a node with View Field attached, or panels you can connect this view.

But it will just list out your images which is not what you really want.
But once you see the list is there you are ready for the next step.

Make you js file .

How I solved my Image Module Issues

I wanted to have a user-friendly icon somewhere so that once my sites were finalized, clients could easily add an image to their web page.

Below is a basic step-by-step description of how to do this. I can now easily insert images of my choosing and from my PC, onto a web page.

Wysiwyg

Overview

The Wysiwyg module provides client-side editors with an easy to follow interface for writing and formatting content. The module also supports third-party editors that change the look & feel of the interface.

Supported Editors

When choosing an editor it's important to check the Supported Editors Matrix for a compatible version.

Alternative Version Control System mirrors of drupalcode.org

To view Official repository, Please visit home page of the project of interest, and click on "version control", or to use the "repository viewer" link on the project home page.

In Addition, some unofficial mirrors have been set up for users of version control systems other than GIT. While it is important to contribute your code back to Drupal's official repository, having a mirror available in your preferred version control system can be useful at times. With that in mind, below is a list of unofficial mirrors. Depending on the mirror, not all history or modules may be included. For more details, see the "about" link associated with each.

Image derivative sizes

Image modules automatically creates smaller sizes of your images for use as thumbnails and so on. These different sizes are called derivatives.

To set sizes for derivatives go to Administer >> Site configuration >> Image.

By default, there are two derivatives and the original size:

Pages

Subscribe with RSS Subscribe to RSS - Needs copy/style review