Drupal Articles » Drupal gallery using CCK and Views » Import the Content Types
You will now import the content types which will make up the gallery. To keep this page tidy, I've provided each as separate text files attached to this page (scroll the bottom to download them). You MUST import the Photo Album content type and the Video Category content type "before" you import the Photo and Video types (this is because these latter two types include node reference fields that connect to the first two types).
For each type, go to Administer > Content management > Content types > Import (admin/content/types/import) and paste in the contents of one of the text files.
This gallery setup makes use of 4 separate content types. As you can likely guess, the Photo and Video types are the actual nodes which hold the photo/video media itself. The Photo Album and Video Category types act as "container" nodes which display groups of related Photo/Video nodes together (by means of an embedded View with a node reference argument, in case you're curious).
While Drupal does already have an excellent Taxonomy system built in for categorization (which may be more appropriate in some situations), the reasons for choosing to use node references in this case instead are:
- There's no particularly great solution currently for allowing a "less privileged" user to add taxonomy terms besides resorting to free tags (actually Taxonomy Delegate is promising, though it still doesn't meet some of the other benefits outlined below). Otherwise the user must have "administer taxonomy" permission, which is both undesirable and confusing for the user. Nodes however are both accessible/familiar to the and also have a wide variety of modules for managing their creation, editing, deleting, etc.
- Container nodes are "owned" by the user that creates them. This opens the door to relatively simple "per user" albums/categories (one potential solution if using taxonomy is Community Tags).
- Container nodes have their Body field, making it simple for the user to include description/introduction text for the album/category. All other node functionality is also available (more custom fields, comments on the album/category itself, search, etc).
- Integration with Popups API along with Popups: Add and Reference module make for a great feature of adding the Container nodes directly from the Photo/Video node creation page.
On the other hand one trade-off with this method is losing the ability (which is simple with taxonomy) to have nested levels of albums/categories.
| Attachment | Size |
|---|---|
| gallery-content-type-photo_album.txt | 2.36 KB |
| gallery-content-type-video_category.txt | 2.39 KB |
| gallery-content-type-photo.txt | 6.56 KB |
| gallery-content-type-video.txt | 7.74 KB |
