cpVille : add Postal code and Insee management in your data > Documentation

This plugin use an internal database to allow user to enter the town name with a helper system.

This plugin is sponsored by Observatoire Régional de la Santé (ORS) - Nord-Pas-de-Calais, Comité Régional du Tourisme de Bretagne and Formations logiciels libres - 2i2l = 42

Demonstration of this plugin in French

Get the real town name in a survey can be very difficult. ANd have only the town name without information like ZIP code or other ID need reworking the Database to be treated in another tool.

This plugin offer a Database with the town name from France and fill the data with information you can need.

Adding a CP/Ville question

To use this plugin, after activation : you just add a Multi short text question. If this multi short text have one subquestion with code “SaisieVille”, the plugin update the public question to allow user to enter quickly the town.

The plugin automatically enter INSEE code in the sub question with code “Insee”, and the ZIP code at the subquestion with code “CodePostal”. The plugin allow more information to be provided in settings or to use another string for Sub question code.

Plugin in action

When the plugin is activated : when the user enter some character in the input : the plugin search for this information in the database and show it to the user.

Search by name
Search by postal code

See the plugin in action with a real survey.

If user enter only numeric character : search is done on Postal code. If use enter 2 string : seearch is done with this 2 string. st or ste is updated to saint and sainte , like / is updated to sur. User can restrict to departement adding the 2 digit of his department.

The extension settings

More dedicated to french user, the settings parameters is shown in french.

Plugin settings of saisieVille in French
answerLibel Code de la sous question de saisie automatisée
The code of the sub question used to launch the autocomplete system. All multi short text question with this code launch the extension, even if there are no other sub-questions used. Default is ‘SaisieVille’.
formatVisualisationFormat des réponses affichée dans la liste
The format of the possible town shown in list : ‘Town name’ or ‘[ZipCode] Town name’. Default is ‘[ZipCode] Town name’.
formatValeurFormat de la réponse finale affichée
Final string put as answers: ‘Town name’ or ‘[ZipCode] Town name’. Default is ‘Town name’.
limitlistNombre de réponse retournée (max)
Maximal number of town returned when searching. Default is 10. When search by postal code with 5 digit : all town are returned.
orderbyOrdonnées les réponse selon
Order the possible answer by : population or alphabetical order. When searching by postal code : this settings is not used : return in alphabetical order only. Default is order by population.
answerCpCode de la réponse de code Code postal
The code of sub-question for postal code/ZipCode. Default is ‘CodePostal’.
answerInseeCode de la réponse pour le code INSEE
The code of sub-question for postal INSEE code. Default is ‘Insee’.
answerNomCode de la réponse pour le nom de la ville
The code of sub-question for the real town name. Default is ‘answerNom’. More used if you choose [ZipCode] Town name for formatValeur.
showCpAfficher la réponse code postal (en lecture seulement)
Show the postal code answer (in read only mode). Default is false.
showInseeAfficher la réponse code insee (en lecture seulement)
Show the Insee code answer (in read only mode). Default is false.
showCopyrightNe pas afficher le copyright des données
Data used in database is copyrighted by La Poste and Insee. Data is published under the Licence Ouverte / Open Licence. You can use on your own system, commercialy or not. But you must add a credit to La poste and Insee

Data used in this plugin is copyright: