views:

25

answers:

3

I've noticed the images in the products content type in ubercart shop have 2 description fields: http://dl.dropbox.com/u/72686/doubleDescription.png

I was wondering if I can do this only with programming or there is some module to do it.

Also, it would be nice to have a text area instead of a single line text field for the description.

thanks

+2  A: 

Those are not descriptions, those are image attributes that can be enabled during the content type definition.

I wouldn't recomment using long texts in ALT or TITLE, but if you really want to, you can change the field to a textarea implementing hook_form_alter() on that form.

Vinicius Pinto
If I change the description field in a CCK Field to text_area using hook_form_alter(), is it displayed as multi-line text in the front-end as well ?
Patrick
A: 

The functionality you describe is provided by ImageField, which is one of the modules recommended from Ubercart.

kiamlaluno
If I change the description field in ImageField to a text_area using hook_form_alter(), is it displayed as multi-line text in the front-end as well ?
Patrick
Yes. If you change the form field to `#textarea`, the field will show as multi-line. `hook_form_alter()` doesn't have the concept of front-end, or back-end; it alters the form wherever it appears. Rather than implementing `hook_form_alter()`, I would suggest to implement `hook_form_FORM_ID_alter()`, which allows to keep the code for altering a form separated from the code to alter another form.
kiamlaluno
+1  A: 

If you look under http://yoursite.com/admin/content/node-type/product/fields/field_image_cache you can see that under Title Text Settings and Alt Text Settings they have those enabled. Just do the same on your content type with the Filefield -> Imagefield field type.

Chris Ridenour
ok, I actually thought they were displayed beside the image, not as attributes.
Patrick

related questions