kbeat
kbeat

Reputation: 149

Drupal: storing images and other module data

Suppose we have a module that displays tables of employees. Each employee has a photo. What is the best way to store this photos and display them?

I mean, is there some kind of content repository in drupal? I don't want to do this manually, maybe there is an API that can store images and then generate links to them and so on.

Thanks.

Upvotes: 0

Views: 1174

Answers (3)

Gokul N K
Gokul N K

Reputation: 2458

What you are looking for is CCK module with file-field and image-field modules for handling the image upload action.

And for the display of those uploaded images you should use Image-cache

Upvotes: 0

jpstrikesback
jpstrikesback

Reputation: 2308

The Content Construction Kit(CCK) / Fields in core is what you want to explore.

Using CCK you can attach an image, a number field, a file, some text, a reference to content, etc to another piece of content.

In Drupal 7 you can add fields to any entity (Content, User...your custom one(Employee)), in Drupal 6 you might want to explore Content Profile

Further Reading:

http://drupal.org/node/717120

Upvotes: 1

berkes
berkes

Reputation: 27593

There is a kind of content repository in Drupal: both in the database and as storage (disk).

The API for that is documented in a special File upload section.

If you want inspiration, the core module called upload.module can serve as example. But be aware that Drupal core, for several reasons, is far from the best and cleanest examples to learn from.

Upvotes: 0

Related Questions