The Contactic plugin (CFDB) comes with shortcodes, allowing you to publicly (or privatly) display submit data.
This can be useful in case you want to make submissions visible:
- a poll that you want to share with all visitors,
- a form that you want to share with other contributors (without having to give them access to WordPress administration)
- a survey …
- a list of participants
There are different types of predefined shortcodes with exclusive options. To access it, go to the page dedicated to the shortcode (link on the name of the shortcode). You can also make your own shortcodes.
Available shortcodes are the following:
wdt_ID | Shortcode | Description |
---|---|---|
1 | [cfdb-datatable] | fournit un tableau filtrable et triable de manière dynamique sur votre page. |
2 | [cfdb-table] | offre des options supplémentaires pour créer un style spécifique sur le tableau. |
3 | [cfdb-json] | génère une balise dans le code HTML dans lequel il définit une variable Javascript égale à une représentation JSON des données. |
4 | [cfdb-value] | permet de présenter une valeur dans la page au lieu d'un tableau ou d'un script JSON. |
5 | [cfdb-count] | permet d'afficher simplement le nombre d'entrées au sein d'un formulaire. |
6 | [cfdb-html] | permet d'afficher vos données au format HTML. |
7 | [cfdb-export-link] | génère un lien cliquable qui permet de télécharger un fichier au format CSV ou XLSX... |
For each shortcode, you have the following common options.
wdt_ID | Option | Exemple | Description |
---|---|---|---|
1 | form | [cfdb-datatable form="monform"] | Requis. Cela indique le formulaire à afficher. Toutes les colonnes et lignes sont affichées par défaut. |
2 | role | [cfdb-datatable form="monform" role="Author"] | Créer des shortcodes visibles uniquement pour certains rôles d'utilisateurs. Les rôles sont ceux autorisés et utilisés au sein de WordPress : Administrator, Editor, Author, Contributor, Subscriber, Anyone. |
3 | show | [cfdb-datatable form="monform" show="col1,col2"] | Limite les colonnes visibles à celles désignées (séparées par des virgules). Supporte des expressions régulières (cf. preg-match) |
4 | hide | [cfdb-datatable form="monform" hide="col1,col2"] | Inverse de show. N'affiche pas les colonnes listées (séparées par des virgules). Supporte des expressions régulières (cf. preg-match) |
5 | header | [cfdb-table form="monform" header="false"] | Montre ou pas l'entête du tableau. True (par défaut, visible) ou false (non visible) |
6 | headers | [cfdb-table form="monform" headers="votre-nom=Nom, champ_1=Email"] | Permet de changer les noms affichés dans les entêtes des colonnes. A la place du nom : 'champ_1', on affiche : 'Email' |
7 | limit | [cfdb-datatable form="monform" limit="10"] | Limite le nombre de ligne visible et commence par défaut par la ligne 0. limit="10" équivaut à limit="0,10". Si vous souhaitez commencer à la centième ligne et n'afficher que les 10 premières lignes, il faut indiquer limit="100,10" |
11 | random | [cfdb-table form="monform" random="2"] | Affiche X lignes aléatoires (2 dans l'exemple) parmi celles existantes dans le formulaire. |
12 | orderby | [cfdb-datatable form="monform" orderby="nom,prenom"] | Trie les lignes en fonction des colonnes désignées. Utilisez "nom desc" pour trier par ordre décroissant (par défaut, ordre croissant). |
13 | search | [cfdb-datatable form="monform" search="Dupont"] | Seules les lignes où une cellule contenant le texte de recherche, en l'espèce 'Dupont' (insensible à la casse) seront affichées. |
Examples of shortcode options
We will use an example form with 12 submissions completed. We want to make them visible on our site.
For example, consider a simple form with few fields: last name, first name, email, subject, message.
The form is named in Contact Form 7: “Form example“.
To display it on a page you must add the following shortcode (from the Contact Form 7 plugin): [ contact-form-7 id=”XX” title = “Form example” ]

Form option
Use the form option with the following shortcode to display the table of submissions corresponding to the form called:
[ cfdb-table form="Form example" ]
You can see the result of the shortcode below.
All records (12) can be seen from the form with all columns (7).
Role option
Use the role option with the following shortcode to show the table based on user roles:
[ cfdb-table form="Form example" role="Administrator" ]
If you are not an administrator … you must see a sentence stating that you do not have sufficient rights!
Show option
Use the show option with the following shortcode to show that some columns:
[ cfdb-table form="Form example" show="your-name,your-surname,your-email" ]
You only have to see the columns that are called.
Hide option
Use the hide option with the following shortcode to hide columns:
[ cfdb-table form="Form example" hide="your-name,your-surname,your-email" ]
You no longer need to see the specified columns.
Header option
Use the header option with the following shortcode to remove the header line:
[ cfdb-table form="Form example" header="false" ]
You must not see the header of the form anymore.
Headers option
Use the headers option with the following shortcode to change the name of the headers:
[ cfdb-table form="Form example" headers="Submitted=Date,your-name=Nom,your-surname=Prénom,your-email=Email,your-subject=Sujet,your-message=Message,Submitted From=IP" ]
Limit option
Use the limit option with the following shortcode to present a restricted number of lines (6) and from the desired line (4):
[ cfdb-table form="Form example" limit="4,6" ]
Random option
Use the random option with the following shortcode to randomly present the number of lines (2) shown:
[ cfdb-table form="Form example" random="" ]
Orderby option
Use the orderby option with the following shortcode to sort the rows according to the named column names:
[ cfdb-table form="Form example" orderby="your-name,your-surname" ]
To sort in the reverse order (z will arrive first), specify the following shortcode:
[ cfdb-table form="Form example" orderby="your-name desc,your-surname" ]
Search option
Use the search option with the following shortcode to change the name of the headers:
[ cfdb-table form="Form example" search="Dupont12" ]
Filter option
Use the filter option with the following shortcode to filter a requested content in a particular column:
[ cfdb-table form="Form example" filter="your-name=Dupont7" ]
The advantage of the filter option is that it can support regular expressions and has full filter operators.