Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Although this can currently be achieved by creating different Phone Number fields, it could be an option for those who needed it. Instead of hardcoding the types (home, work, mobile, fax), configurable options like CCK textfield select options is preferred way to go.
Comment | File | Size | Author |
---|---|---|---|
#16 | node_form.png | 17.72 KB | sportel |
#16 | node_view.png | 9.75 KB | sportel |
#16 | cck_phone.zip | 35.01 KB | sportel |
#14 | cck_phone-optional_comment_field-849006-14.patch | 3.21 KB | Leksat |
#13 | cck_phone_phone_types-849006.patch | 5.23 KB | tmanhollan |
Comments
Comment #1
ckngarpeggio has been suggested to include hCard microformat support (with phone type selection: Voice, Home, Msg, Work, Pref, Fax, Cell, Video, Pager, BBS, Modem, Car, ISDN, PCS) in [848740].
I'm not familiar with vCard and hCard, perhaps those who has better ideas can chip in the discussion.
According to http://microformats.org/wiki/hcard,
tel type: VOICE, home, msg, work, pref, fax, cell, video, pager, bbs, modem, car, isdn, pcs
The list is rather different from usual user requests - home, mobile, work, personal, misc
Comment #2
arpeggio CreditAttribution: arpeggio commentedThis is an upgrade patch at http://drupal.org/node/865054 supporting hCard microformat. Microformat defined: Voice, Home, Msg, Work, Pref, Fax, Cell, Video, Pager, BBS, Modem, Car, ISDN, PCS. My suggestion is a fixed values as select box because vCard application parsers looked for those specific keywords (case insensitive). You may want to try a vCard application parser of Firefox - the Operator toolbar plugin.
This is not a standalone hCard microformat, this is only a part of the structure of hCard microformat, specifically the tel item. The hCard microformat requires n or fn item to be a complete vCard. Example:
The only part the Phone number module for D7 can generate is:
The Phone number module for Drupal 7 offers additional field for user's annotation. For example:
Comment #3
ckngSince phone number is just a small puzzle in hCard, have you check out Addresses, hCard or vCard?
We can always output our fragment, but it will make more sense within the hCard block.
The types are fixed, I wonder if it is possible to mask the input with another name. Compare 'mobile' with 'Cell', end user might not get it when they see it. For output we probably can hide the type using CSS.
Comment #4
ckngWait for D7 to be ready.
Comment #5
arpeggio CreditAttribution: arpeggio commentedI have tried Addresses module before. That module is a complete vCard, my comment it has no advance validation/sanitation/formatting for phone number like our Phone number module offers.
Yes, we are already supporting an option to hide the phone type and also supporting annotation which enable the user to add a more descriptive information (like Mobile) about the phone number. These features are all available in that patch.
Comment #6
ckngThat's why I suggested possible integration with other modules, where Phone number provide them the phone output or pass them the needed data that has been validated/sanitized/formatted.
Comment #7
BenK CreditAttribution: BenK commentedSubscribing
Comment #8
johnvsubscribe.
Comment #9
CraigBertrand CreditAttribution: CraigBertrand commentedWhere are we at on this? I really need this for drupal 6.
Is the patch above only for 7?
Comment #10
rooby CreditAttribution: rooby commentedFor those who want it in D7, a temporary solution is to use the field_collection module and add your own type field with the phone field in the collection.
I am doing this and it works ok, although isn't probably as good as it would be to have it in the same field.
Drupal 6 people could do a similar thing with cck 6.x-3.x
Comment #11
almaudoh CreditAttribution: almaudoh commentedWhen will d7 be ready. I'm interested in using this module for my upcoming d7 project and I'd like to help speed up the development efforts. I can help maintain the module also.
Comment #12
ckngI would say the current blocker is #1138024: Token hooks are incorrect for D7, I've no time to work on it ATM.
Comment #13
tmanhollan CreditAttribution: tmanhollan commentedI need the basic functionality for d6. I just need to store a type label with the number, so I did a quick patch to accommodate my needs. It's not as complex as what was originally suggested, but it works for me. Feel free to apply or extend as needed.
This patch:
Comment #14
Leksat CreditAttribution: Leksat commentedHuh... I should found this issue first.
I did the same job: created a patch which adds additional optional field "Comment".
Well... The work is done anyway, so I'm attaching my patch. It mach simpler than from #13, it add just text field. And it for 7.x version
Comment #15
sportel CreditAttribution: sportel commentedA list with selectable phone-types would be very welcome. This is also useful for making proper validation for certain countries. For in the Netherlands, a mobile number always starts with 06-...
Mike.
Comment #16
sportel CreditAttribution: sportel commentedI've used the patch from #14 (thanks Leksat) to make a selectlist for selecting the phone number type. It works fine, but since I'm no developer (just used some copy/paste) I'd like to hear from you all if this is properly done, and perhaps there are some suggestions for additional phone number types? Also, I've added the complete module, because I have absolutely no idea how to create a patch file.
See attached pics for the changes.