Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
Tagged: 8.2.1, extension, form, link, phone number
- This topic has 6 replies, 2 voices, and was last updated 8 years, 9 months ago by
Steven Zahm.
-
AuthorPosts
-
03/05/2015 at 2:59 pm #321778
William Rockwood
ParticipantGreetings,
I’m currently using connections to create and manage a staff directory for a public library. Initially, I extended the Phone field by editing the various class files to create an ‘extension’ key based on the ‘workphone’ key and that works well, until it’s time to update the core extension. ;)
I’ve put some time into investigating alternatives, such as creating a stand-alone sub-plugin based on your ‘Hours’ or ‘Education Levels’ plugins to extend the Phone fields without modifying the core plugin, but I wanted to check to make sure that’s even possible or recommended. It’s one thing to create a whole new field but quite another to alter or supersede an existing field, I would think?
Also, there is some (ok, more than some) interest within my organization for staff to edit their own entries (we’re using google apps login for authentication, so usernames end up being email addresses, which would also be present in the connections entry for each user). Is this possible out of the box? If not, is it a feature you’re considering? If not, any idea how many hours it would take to write up a sub-module to provide that functionality? I looked at your ‘Form’ extension and it seems to be not quite what I am looking for in terms of functionality (though I may just grab it for the simplified/streamlined entry editing functionality)
I very much appreciate any insight or suggestions you can provide. Thanks!
03/05/2015 at 4:10 pm #321779William Rockwood
Participantgrin I just found the ‘Link’ extension, which will solve part of my question quite easily!
So the only remaining question is, is it feasible to modify/add phone fields using a modified version of, say, ‘Education Levels’? Or is there a much simpler way?
Thanks again!
03/09/2015 at 9:40 am #322092Steven Zahm
Keymaster@ William
The one part I do not quite follow and need a bit more detail on…
The phone field supports free-text; it is not limited to just numbers or a particular number format. This design decision was on purpose to allow a wide range of input. That said, why not just enter number
123-555-1212 ext 123
? This is how I’m am familiar with seeing such info on business cards and such.03/09/2015 at 11:23 am #322107William Rockwood
ParticipantI could do, and am doing that in the “Work Phone” field (listing the phone number as “nnn-nnn-nnnn xnnn”, but I need an extension field that lists only the extension. I could relabel the output in the theme, but it feels pretty unprofessional to tell my users to put their extension in the “work fax” field or whatever. I also will be using this data with a separate json export plugin so I can feed my cisco phone directory.
If the answer is to open the core plugin files with vim and re-add the “extension” key to the phone field every time there’s an update, so be it, I guess.
03/09/2015 at 1:36 pm #322119Steven Zahm
Keymaster@ William
Understood…
The best way to handle this which will require a bit more up front work but will be update safe is to add your own metabox for phone numbers à la the “Education Levels” extension and then unregister the core phone numbers metabox so you only have one with your modifications. And most of the work is simply copy/pasting.
I would copy the entire code for the phone numbers metabox:
https://github.com/Connections-Business-- Directory/Connections/blob/8.2.1/includes/class.metabox-entry.php#L1739
Make your changes and register it using the same array attributes:
https://github.com/Connections-Business-- Directory/Connections/blob/8.2.1/includes/class.metabox-entry.php#L144
Use this method to do the actual metabox registration:
To unregister the core phone number field, this should work:
cnMetaboxAPI::remove( 'metabox-phone' );
You can hook into the
cn_metabox
hook to make this happen:add_action( 'cn_metabox', array( 'cnEntryMetabox', 'init' ), 10 );
Step by step:
- Hook a new function to the
cn_metabox
hook. - The function should unregister the
metabox-phone
metabox. - Set up an array with the exact same attributes.
- Register your custom phone metabox.
Hope that helps.
03/09/2015 at 2:50 pm #322127William Rockwood
ParticipantAh fantastic! Thank you. This will help immensely. I really appreciate your responses and must say we have clearly made the right choice in going with this plugin for our staff directory. I will be sure to leave a rating/review for Connections in the wordpress plugin directory. Thanks again!
03/09/2015 at 3:41 pm #322132Steven Zahm
Keymaster@ William
No problem! An thanks for taking time to leave a review, truly appreciated!
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.