Hi:
I really like the Contact List module but want to use cleaner URLs. For example, let's say that I'm using Drupal for the Atlanta Web Entrepeneurs group (which is what we plan to do) and one of my categories is "Programs Committee." That would produce the following URL:
http://www.atlanta-web.org/contact/Programs+Committee
Doing only simple manipulation of the category name i.e. strtolower(str_replace(" ","-",$category)) we could have this, which is better:
http://www.atlanta-web.org/contact/programs-committee
We could also provide an option to use the first word lowercased (which would work for me but I'm not sure how generally applicable it would be):
http://www.atlanta-web.org/contact/programs
Which brings me to preferring that the user gets to manually enter the URL "slug" (providing in my case the same URL as the previous example):
http://www.atlanta-web.org/contact/programs
I'm adding this as a feature request not to ask you to do it but because I will be making this change for my use and I'd like to know if you'd accept my updates as a new version?
-Mike Schinkel
Comments
Comment #1
behindthepage commentedSounds like a good idea Mike. I would love to have your input. As you have said it is not that hard to do.
Check out your other request as I have more info there.
Regards
gpdinoz
Comment #2
mikeschinkel commentedCool. Here's a link for others who in the future may want to follow our discussions.
Comment #3
mikeschinkel commentedHi gpdinoz: I'm working on implementing the clean URL and can get it working and also get an option field to show up on the admin form, but I can't get it to save. I've looked at all your code and cannot see how you persist your values. Do I need to create some kind of hook in contact_list.module or even in contact.module? Thanks in advance.
Comment #4
behindthepage commentedAny form names(?) in hook_admin_settings will be saved (automatically) in the variables table. The way I do it is by altering the contact module settings form [which is defined in contact_admin_settings() in the contact module] with hook_form_alter function.
This altering is done in contact_list_form_alter() [or contact_forms_form_alter()]
I hope this sheds some light on it.
Regards Geoff
Comment #5
mikeschinkel commented@gpdinoz: Any form names(?) in hook_admin_settings will be saved (automatically) in the variables table.
Strange. I modified contact_forms_form_alter() to include a checkbox field and used variable_get() and it worked on the form but it didn't persist the information.
I'll look at it some more...
Comment #6
behindthepage commentedCleaner URLs have been implemented in the latest release. Thanks for your input Mike.
Comment #7
mikeschinkel commentedThanks. Sorry I had to jump onto other projects and didn't follow up. Can I blame my clients for changing my focus? :-)
Comment #8
behindthepage commentedSure you can, without clients we would have no problems at all.
Comment #9
behindthepage commentedTransfered from Contact List