Adding the view to the gallery

Now we want to add a viewfield to our image gallery node type to display the thumbnails of the images in this gallery. Go to admin/content/types and click “manage fields” on the image gallery.

Enhancements

I must admit, it does not look like a nice image gallery. But now, we want to add a view that collects all images in this image gallery and displays a clickable thumbnail view of the images in this gallery below the body text.

So, go to admin/build/views/add and add a view named “gallery” (or any other name you like). Select “node” as the view type. Click “next”.

On the next complex page you configure the view. We will start with the construction of the SELECT statement:

First we want to define the relationships: Click on the plus-sign near “Relationships” and then check “Book: Parent”. Click “Add”.

Then we want to define the arguments for the view: Click on the plus-sign near “Arguments” and then check “Node: Nid” and click “Add”. Then select “Book parent” as relationship, Action to take if argument is not present: “display empty text”, “Node” as validator, “image gallery” as allowed types and “Node ID” as argument type. Click “Update”.

Now we define the field to display: Click on the plus-sign near “Fields” and check “Content: field_image” and click “Add”. Then select “Do not use a relationship”, Label: “none”, and as Format select the "small_quadrat image linked to node” (the preset you defined on the image cache configuration page). Click “Update”.

Create content

Now we can create content: Create new content of type “image_gallery”. Don't touch the section “Book outline”! Remember the node id, we us it later with views.

Define new content types

First, go to admin/content/types/add and create a node type for the image gallery with type “image_gallery” (or any other system name, as you like). In the section “BookMadeSimple” only check “Auto create book main page”.

Second, create a node type for images with type “image” (or any other system name, as you like). In the section “BookMadeSimple” only check “Select content-types as parent: image gallery”. Thus you have connected your images with the image gallery.

Module configuration

Go to admin/build/imagecache and define the following presets:

Here we go!

Download all modules in the current official released version. If there is only a dev-release, use this.

After downloading, go to admin/build/modules and activate the following modules:

  • In section “CCK”: Content, FileField, ImageField, Viewfield
  • In section “Content”: BookMadeSimple
  • In section “Core – optional”: Book
  • In section “ImageCache”: ImageApi, ImageApi GD2, ImageAPI ImageMagick, ImageCache, ImageCache UI
  • In Section “Other”: Token
  • In Section “Views”: Views, Views UI

Pages

Subscribe with RSS Subscribe to RSS - Site administrators