[This topic mainly regards Revolution, but Evolution is not out of the question.]
As part of my
quest to Revolutionize www.compeek.net (pun fully intended), I’ve realized that it would be useful to have an efficient, easy way to manage contacts that will be accessible via my contact form. This will also be useful for me in other projects, so I figure it’s worth investing the time in.
On an Evolution site I’ve been working on for a client, I needed a quick way for the client to able to add/edit/remove contacts for the form I created for them using eForm. I couldn’t find a suitable way to do it with a module or anything, so I just created a bunch of child documents under the Contact Us page and made a few template variables. I then wrote a quick snippet to fetch each contact’s details (name, position, and email address) and set some placeholders to use in my eForm form and in the snippet call (specifically for the &to parameter. I used eForm’s eFormOnBeforeFormParse event to call my a function in my snippet. The end result was a pretty quick and dirty way for the client to be able to edit these contacts themselves and to have the contacts show up in a pull down box on the contact form, all without revealing any email addresses (for spam protection).
The problem I have with this approach is that, in my opinion at least, MODx documents are meant to represent pages of the site. I realize they can serve a lot of purposes using template variables, but I’m just not satisfied with this approach because it doesn’t feel right. I also would really like some experience creating a component for Revolution, so I’m considering writing one.
This component would connect to a database table to add/edit/remove contacts. It would provide an interface for the manager to manage the contacts. I would also create a snippet or two for generating lists of the contacts for use in contact forms. The fields I have in mind at the moment are id (a given, of course), name, job position, and email address.
Does this seem like a good idea? What other fields might be critical for this if I created it?
I appreciate any input, even if you want to say you think it’d be a waste of time. Thanks.
Edit: Some things I just thought of to include are IM screennames, and possibly a link to a MODx user (for example, if I’m the webmaster and I have a MODx user account, the contact entry for me would record my user id for automatically loading some of the fields, or something like that).