First impressions

yched - March 16, 2007 - 00:23
Project:Fullname field for CCK
Version:5.x-1.0
Component:Code
Category:feature request
Priority:normal
Assigned:rconstantine
Status:closed
Description

Nice little module :-)

A few remarks :
- I don't get why you skip regular cck formatters. This bypasses the ability for the user to pick his display format in the 'display fields' tab or in views. And forces yous to declare your own hook_field('view') op, which is usually best left to content.module.
- it seems there is definitely a case for 'multiple' : what about lists of people ?
- it would be great for non-anglophone countries if you provided an option to skip middle name completely.
n France (and in a lot of other countries), we just don't have middle names :-)

#1

rconstantine - March 16, 2007 - 00:48

Thanks for looking at it. In answer to your questions:
- Maybe I don't fully understand the formatters. The way I understand it, it just allows the safe use of html or php or whatever. I just thought that since names should only have alphanumerics, I'd just take care of it myself. I'd appreciate any corrections to my understanding.
- Hmm, maybe. That sounds more like a 'view' to me. I figure that if one person is filling in a name, they're only going to fill in their own. If someone wants to list users for some reason, I figured that would be some kind of widget to select already-entered people. But I'm open to giving the option. Could you give a more specific example?
- That's a fine idea. Currently, if the fullname field is required, the middle name part isn't. I thought I made a note there somewhere about that. Maybe I didn't.

#2

yched - March 19, 2007 - 12:00

The way I understand it, it just allows the safe use of html or php or whatever
Not only. CCK formatters allow you to define several ways to output the field's data, and let the user choose which one he wants for his field, and have different output formats in his teasers and in his full nodes.

For instance, you might want to output
- 'first name - middle name - last name'
- 'first name - Initial of middle name - last name'
- 'initial of first name - Initial of middle name - last name'
- etc...

And yes, formatters are supposed to take care of proper filtering (check_plain / check_markup) and provide 'safe for output data'. Even if your data is supposed to be alphanumeric only, I guess it's always best to run through check_plain before handing it for output.

You could look at number.module for a simple but rich use of formatters.
Actually, I think you're _supposed_ to provide at least one 'default' formatter, BTW...

I figure that if one person is filling in a name, they're only going to fill in their own
Why is that ? You have to think of your field in a much generic way - site admins will use it to fill their own needs .
Say, your 'name' field would be great in my 'movie' content type, for listing the names of actors. But I'll need it 'multiple'.
(OK, if I want to make a 'real' Imdb-like movie database, 'actor' will be a content type in itself, and 'movie' will list nodereferences to the nodes of the cast, but you see what I mean)

the middle name part isn't
Yes. I guess I'd wan't my french site contributors not to even see the 'middle name' form element, since it means nothing to them, and makes the site look 'not designed for them'.
Non critical, obviously. That's only a detail and if I'm able to code I can 'manually' remove them using a 'hook_form_alter' anyway, but it's those kind of friendly features that come really appreciated if you aim at an 'international' audience - and drupal is international :-)

#3

rconstantine - March 19, 2007 - 17:50

Three things. First, I will go ahead and look further into formatters. It's funny you mention the number module because I used the number module as a reference in doing part of the address module.

Second, I concede the point of the multiple instances. I seem to recall a technical issue in allowing that, but I'll double check.

Third, I'll go ahead and add a checkbox in the admin UI to show/hide the middle name field as soon as I get a chance.

Again, thanks for looking into this.

#4

rconstantine - April 12, 2007 - 04:55

Update: I had hoped to get to this today. Should be able to get to this by next Wednesday.

I think I now understand the formatters and will implement several options.

I will also add in the multiple option as I can see a use for that.

Also see http://drupal.org/node/129165. I'll take care of that too. For now, I'll probably just do the traditional html/php filtering. This will mean that people could have a name like J.#hs$865 $ishf SDDij4, but I don't know how else to accept foreign characters since PHP's implementation of regex is lacking. If anyone has tips on this, I'd appreciate hearing about them.

#5

rconstantine - May 26, 2007 - 00:49

Now have formatters working as it should. I have pulled out the regex validation. This should allow foreign characters now. I made the option to exclude middle names. And lastly, I'm trying to get my css page to work with multiple names, then the 'multiple' option will work and I'll upload all my changes as a new dev release. Should happen later today.

#6

rconstantine - May 26, 2007 - 02:36
Assigned to:Anonymous» rconstantine
Status:active» fixed

#7

Anonymous - June 9, 2007 - 02:49
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.