HowTo: Add a Gallery Relationship

Last updated on
30 April 2025

A gallery relationship consists of two related content types. One content type for the ( gallery node ) and another content type for the ( image nodes ). The Add a Gallery Relationship function ties these two content types together to form A Node Gallery.

  • The Gallery content type is listed on the create content page and is visible to the end user. The gallery node handles all creation, display and editing functions for the gallery (it is the control and display panel for each gallery). The gallery node calls upon the image nodes when they are needed for display or editing.
  • The Image content type is (not) listed on the create content page and is (hidden) from the end user. The image nodes are used internally by the gallery node. The image nodes are called upon by the gallery node when needed.
  • When adding a gallery relationship, the gallery_image content type (can be re-used). The gallery content type (can not be re-used) as it will overwrite the existing relationship that uses it.

For this Relationship example: Lets make an art collection that displays oil paintings.
There will be an ( art_collection )content type and an ( oil_painting )content type.

  1. Goto: Administer > Content management > Content types > Add content type
    system path admin/content types/add
  2. Name the new content types so they are easy to find in the content list when administering the website content.

  3. Create a content type for the (art_collection node) that will display and manage the (oil_painting nodes).
    *This will be visible on the Create content page. ( example: Create content > Art collection )
    Content Type examples:
  4. node_gallery_gallery
    my_gallery_gallery
    art_collection
  5. Create a content type to hold the ( oil paintings ) for the ( art collection ).
    *This is the image content type to be displayed by the gallery content type.
    *This will not be in the create content list, and will not be visible to the end user(see next step).
    Content Type examples:
  6. node_gallery_image
    my_gallery_photo
    oil_painting
  7. Uncheck the (content type named in step 3) in the Navigation Menu to remove it from the create content list.
    *This will not be in the create content list because it is used internally by the art_collection node.
    Goto: Administer > Site building > Menus > List
    system path admin/build/menu/list
    choose Navigation and Uncheck the new ( oil_painting ) content type named in step 3 above.
  8. - oil_painting
  9. Add new ImageCache Presets for cover, thumbnail and display (or) skip this and reuse existing presets.
    Goto: Administer > Site building > ImageCache > List
    system path admin/build/imagecache/list
    Name the new imagecache presets so they are easy to recognize for future gallery settings.
    example names: art-collection-cover, art-collection-display and art-collection-thumbnail.
  10. Set the URL aliases for the new art collection and oil painting content types if using Pathauto.
    Goto: Administer > Site building > URL aliases > Automated alias settings
    system path admin/build/path/pathauto
  11. > Node path settings:
    Pattern for all art collection paths:
    art-collection/[title-raw]
    Pattern for all oil painting paths:
    art-collection/[parent-node-gallery-title-raw]/[title-raw]
  12. Set the permissions for the new imagecache presets and content types ( art_collection and oil_painting )
    Note: The oil_painting content type is not visible on the create content page, but still needs permissions in order to add, delete and edit oil paintings in the art collection.
    Goto: Administer > User management > Permissions
    system path admin/user/permissions
  13. > imagecache module
    view imagecache art-collection-cover
    view imagecache art-collection-display
    view imagecache art-collection-thumbnail
    > node module
    create oil_painting content
    create art_collection content
    delete any oil_painting content
    delete any art_collection content
    delete own oil_painting content
    delete own art_collection content
    edit any oil_painting content
    edit any art_collection content
    edit own oil_painting content
    edit own art_collection content

    ( Save )


    You now have: 2 content types, Create content page in order, Imagecache presets, URL aliases, Permissions and you are ready.

  14. Add a Gallery Relationship:
    Goto: Administer > Site configuration > Node Gallery > Add a Gallery Relationship
    system path admin/settings/node_gallery/add
  15. Select the gallery content type created in step 2 using ( radio buttons )
    ( art_collection )
  16. Select the gallery image content type created in step 3 using ( radio buttons )
    ( oil_painting )

( Next )


! A New Gallery Relationship has been created !
----------
Set up the new art gallery now that it has been created.
Same configurations page with small differences(page labels).

2nd setup screen Node Gallery

    Gallery Type Name:
    The name to show on create content page.( examples: Art collection or Oil painting collection )
    Gallery Directory:
    Set the directory to hold images inside sites/default/files/[name or token]/[name or token]
    Default Cover Image:
    Specify a default cover image to show when there are no images in the gallery.
    Number of uploads:
    Select the number of upload buttons(fields) for images on each upload page.
    (Please use caution when adding more than 4 or 5 as php.ini settings may need to be changed.)
    Fields:
    Specify the fields to show(check boxes).
    Title, caption, revision info, comment settings, path settings.
    Choose the content you want to display:
    Specify the description text to be used when displaying image pages.
    Choose gallery description (or) image description.
    Image Comment Setting:
    Specify the comment setting to use. (Image or gallery) as per setting in the content type.
    Images Sizes:
    Select which Imagecache Preset to use for each image display(cover, thumbnail, display).
    Original Image Display:
    Set the option to allow viewing full sized image disabled, with a link or lightbox2 pop-up.
    Teaser setting:
    Specify how to display the gallery and image when viewing the node as a teaser.
    Gallery Landing Page Setting:
    Choose thumbnails or thumbnails that open a lightbox2 gallery.

Image Upload Limitation Default Settings:

    Default permitted file extensions:
    Specify allowed file types ( jpg jpeg png ) (do not use a dot, just a space between each)
    Maximum resolution for uploaded images:
    Specify (width x height) in pixels. (use 0 for no limit, if there is trouble with uploads check this)
    Default maximum file size per upload:
    Specify a number in MB (calculated after Imagecache Preset re-sizes the files)
    Default total file size per user:
    Specify a number in MB (combined total size of all files a user is allowed to have in the system)
    Default total file number per user:
    Specify a number. (combined total number of files each user is allowed to have in the system)

Image Upload Limitation Settings for anonymous user:
note: This will not be visible until permissions have been set.

    Default maximum file size per upload:
    Specify a number in MB (calculated after Imagecache Preset resizes the files)
    Default total file size per user:
    Specify number in MB (combined total size of all files a user is allowed to have in the system)
    Default total file number per user:
    Specify a number (combined total number of files each user is allowed to have in the system)

Image Upload Limitation Settings for authenticated user:
note: This will not be visible until permissions have been set.

    Default maximum file size per upload:
    Specify a number in MB (calculated after Imagecache Preset re-sizes the files)
    Default total file size per user:
    Specify a number in MB (combined total size of all files a user is allowed to have in the system)
    Default total file number per user:
    Specify a number (combined total number of files each user is allowed to have in the system)

Image upload limitation settings for Each User Role will display below authenticated user settings. The settings will not be displayed until permissions have been set for each of those roles.

( Previous )  ( Submit )


Now there is an art collection node that displays oil painting nodes, a node_gallery.
Additional configurations can be made to the submission forms. See ( HowTo: Configure Node Gallery )

! Create a Gallery using the new Gallery Relationship !
Goto: Create content > Art collection or ( Gallery Type Name: specified in the setup )

Help improve this page

Page status: Not set

You can: