Change displayed wording of column headings Contact Form 7
-
Is there any way t0 change the displayed wording of the column headings on a non-admin web page using the [cfdb-table] short code without changing the Contact Form 7 field names. The table on the admin page does not have to be affected.
Example Form 7 field name : “your-name”
I would like it to read “Name” on the non-admin web page. Can remain “your-name” in the admin table.https://www.ads-software.com/plugins/contact-form-7-to-database-extension/
-
Use “headers” on the short code.
Thanks, Michael.
I tried that earlier so must be getting something wrong. For that to work, do I need to enter all fields either as demonstrated or as hidden?
I tried the first couple of fields to see if I was getting it correct and found no change (there are many fields):
[cfdb-table form="Referral Form" headers="text text-617-date-g1-1=Date,text text-617-dob-g1-1=DOB" role="Editor" permissionmsg="true"]
I’d be surprised if the field name has a space in it “text text-617-date-g1-1″….sure it isn’t “text-617-date-g1-1”?
It’s cut/paste from form code. Used CF7 Skins. Either that or CF 7 forms uses that double text syntax.
For the heck of it tried it without one of the “texts” – no change in results.
Here’s snippet from form”
<fieldset> <legend>Client information</legend> <ol class="grid"> <ol data-row-span="5"> <li data-field-span="1"> Today's Date [text text-617-date-g1-1]</li> <li data-field-span="1"> DOB [text text-617-dob-g1-1]</li> <li data-field-span="3"> Client's Name [text text-422-cl-name-g1-3]</li> </ol>
Submit the form then look at the submission in the CFDB Admin page. The column headers shown there are the field names.
I see. The first “text” is dropped. When I use that I still get no change.
Cleared browser cache.`[cfdb-table form=”Referral Form” headers=”text-617-date-g1-1=Date,text-617-dob-g1-1=DOB” role=”Editor” permissionmsg=”true”]’
Context:
You know how the records in the CFDB Admin page are links so each can be opened. That’s what I’d like the admin assistants to see and use – preferably not on the admin page. They need to see each record individually.Then I’d like to have the opened records formatted, ideally to fit one 8X11.5 inch page. This so they can be printed and faxed to the folk who need that medical information.
Michael (or anyone), any thoughts on
1. printing out individual records
2. formatting those records independent of theme formatting?The formatting is so the records can each be printed on 8 1/2 X 11 inch paper.
(Site owner is anxious to take new site design live and this is the hold up.)
Will start a new thread on this question as it doesn’t fit this thread’s title.
You can craft master-detail pages where you have a listing (the master) with links on each entry that opens in another page to show the detail.
Let’s start backwards, with the detail page first. I suggest that you put a [cfdb-html] short code on that page with a filter like this:
[cfdb-html form="your-form-name" filter="submit_time=$_GET(st)"] Your html template / formatting here to make it nice for printing I'm not sure how to make this independent of the theme. You may need to create a custom them page where you remove a lot of stuff [/cfdb-html]
The key is the $_GET(st). For the page to work, it will need to have “&st=xxxxx” in the URL where xxxx is different for each entry. See: https://cfdbplugin.com/?page_id=116
Back on the master page, you want to list all the entries but make them have a link to the detail page with the “&st=xxxxx” appended to the URL. This might be a little hard to follow, but you want something like the below, that added a “link” column and makes the values a link to the detail page.
[cfdb-table form="your-form-name" trans="link=concat(submit_time)"] <script type="text/javascript"> (function ($) { $('td[title="link"] div').each( function () { $(this).html( // change url below to point to your detail page '<a href="https://your-site.com/?p=000' + '&st=' + $(this).html() + '">link</a>'); }) })(jQuery); </script>
Thanks, Michael. This makes sense.
Quick clarification while I digest the details of what you’ve written:
You wrote, “Your html template / formatting here to make it nice for printing I’m not sure how to make this independent of the theme.”
I really don’t need the formatting independent of the theme’s formatting. I wanted to be clear that I wanted the individual records formatted so they fit on the ordinarily sized sheets used in the US.
If I understand what you wrote, I put in the html with internal styles where indicated. This will override the theme styles in the way a child theme works.
OK. My point is that figuring out the styles is up to you.
Yes, understood.
Not quite there. Getting no response: Details page has not content when viewed.
Could be I’m missing the flow of the pages or some detail(s) in the code – or both.
Link used is from one of the test submissions. When “detailed” page is viewed, the url is https://xxx.com/dir/index.php/details/ instead of the link used in the code,
https://helptherapist.com/dir/wp-admin/admin.php?page=CF7DBPluginSubmissions&form_name=Referral+Form&submit_time=1443937481.6218Master:
[cfdb-table form="your-form-name" trans="link=concat(submit_time)"] <script type="text/javascript"> (function ($) { $('td[title="link"] div').each( function () { $(this).html( // change url below to point to your detail page '<a href="https://xxx.com/dir/wp-admin/admin.php?page=CF7DBPluginSubmissions&form_name=Referral+Form&submit_time=1443937481.6218' + '&st=' + $(this).html() + '">link</a>'); }) })(jQuery); </script>
Details page (doesn’t show formatting but html formatted well):
[cfdb-html form="referral-form" filter="submit_time=$_GET(<a href="https://xxx.com/dir/wp-admin/admin.php?page=CF7DBPluginSubmissions&form_name=Referral+Form&submit_time=1443937481.6218" target="_blank">st</a>)"] <h1 align="center"> Referral Form</h1> <p><label>Date: <input id="text-617-date-g1-1" maxlength="20" name="Date" size="12" type="text" /> </label> ???????????????????????????????????????????????????????????????? <label>DOB: <input id="text-617-dob-g1-1" maxlength="20" name="DOB" size="12" type="text" /> </label></p> <p><label>Client's name: <input id="text-422-cl-name-g1-3" maxlength="50" name="Clients_name" size="30" type="text" /> </label> <label><br /> Street address: <input id="text-500-street-g2-1" maxlength="60" name="Street_address" size="40" type="text" /> </label> <label>City: <input id="500-city-g2-2" maxlength="25" name="City" size="10" type="text" /> </label> <label>State: <input id="text-500-state-g2-4" maxlength="3" name="State" size="4" type="text" /> </label> <label>Zip: <input id="text-500-zip-gl2-3" maxlength="15" name="Zip" size="5" type="text" /> <br /> </label> <label>Home Phone: <input id="cf7s-phone-g3-1" maxlength="15" name="hphone" size="15" type="text" /> </label> <label>Cell Phone: <input id="cf7s-mobile-g3-2" maxlength="15" name="cphone" size="15" type="text" /> </label> <label>SS#: <input id="text-384-ssn-g3-3" maxlength="12" name="Social_Security_Number" size="12" type="text" /> </label></p> <p><label><strong>Referred by</strong>:<input id="cf7s-referred-by-name" maxlength="50" name="Referred_by" size="50" type="text" /> </label> <label><strong>Phone</strong> # <input id="tel-617-rphone" maxlength="30" name="rPhone" size="12" type="text" /> <br /> </label> <label><strong>Agency Name</strong>:<input id="text-813-agency-name" maxlength="40" name="Agency_Name" size="40" type="text" /> </label> <strong> <label>Fax</label> </strong> <label> # <input id="tel-617-fax" maxlength="30" name="rFax" size="12" type="text" /><br /> </label> <em>Please? Email me? your newsletter</em> -<em> <label>Email</label> </em> <label>: <input id="email-676-nl" maxlength="50" name="rEmail" size="40" type="text" /> </label></p> <p><strong>Psychological Testing And Evaluation Requirements:</strong><br /> <label>Referring MD name: <input id="text-605-ref-md" maxlength="40" name="rMd" size="30" type="text" /> </label> <label>Phone # <input id="tel-823-ref-md-phone" maxlength="30" name="r2Phone" size="12" type="text" /> <br /> </label></p> <p><strong>Insurance Information </strong> <br /> <label>Medicare Number: <input id="text-867-medicare-num" maxlength="20" name="Medicare_Number" size="16" type="text" /> </label> <br /> <label>Primary Insurance Name: <input id="text-787-pri-ins-name" maxlength="60" name="Primary_Insurance_name" size="60" type="text" /> </label> <br /> <label>ID# <input id="text-777-pri-id" maxlength="20" name="piid" size="20" type="text" /> </label> <label> Group# <input id="text-777-pri-grp" maxlength="20" name="pigp" size="20" type="text" /> </label> <br /> <label>Secondary Insurance: <input id="text-777-sec-ins" maxlength="55" name="Secondary_Insurance_name" size="55" type="text" /> </label> <br /> <label>ID# <input id="text-777-sec-id" maxlength="20" name="siid" size="20" type="text" /> </label> <label> Group# <input id="text-777-sec-grp" maxlength="20" name="sigp" size="20" type="text" /> </label> <br /> Primary Insured: <br /> <label>Primary_Insured: <input id="checkbox-62 " name="Primary_Insured" type="text" /> </label></p> <p><label>Primary Physician Name: <input id="text-913-pri-nd-name" maxlength="30" name="Primary_Physician" size="30" type="text" /> </label> <label>Phone: <input id="tel-773-pri-md" maxlength="20" name="Telephone_Number" size="20" type="text" /> </label> <label>Psychiatrist Name: <input id="text-913-psych-name" maxlength="30" name="psychiatrist" size="30" type="text" /> </label> <label>Phone: <input id="tel-773-psych-tel" maxlength="20" name="psTelephone_Number" size="20" type="text" /> </label><br /> <label>Psychiatric Medication: <input id="text-913-psych-meds" maxlength="100" name="Psychotropic_Meds" size="55" type="text" value="" /> </label> <label> Support System: <input id="text-913-support" maxlength="20" name="Support_System" size="20" type="text" /> </label></p> <p><label><strong>Reason For Referral:</strong><textarea id="textarea-608-reason" cols="80" name="Reason_For_Referral" rows="5"></textarea> </label></p> <p><label> <strong>Requested Place of Service:<br /> </strong> <input id="checkbox-528 " name="place_of_service" type="text" /> </label> <label> <strong><em>Email required</em></strong>: <input id="email-502-place" maxlength="50" name="vEmail" size="40" type="text" /></label></p> <p><label> <strong>Special Needs:</strong> <input id="checkbox-528-special " name="place_of_service" type="text" /> </label></p> <hr /> [/cfdb-html]
You seem to be confused about $_GET(). Use it like this:
[cfdb-html form="referral-form" filter="submit_time=$_GET(submit_time)"]
Changed as suggested:`<p>[cfdb-html form=”referral-form” filter=”submit_time=$_GET(submit_time)”]</p>’
The Remainder of the code unchanged from what is posted previously.
WordPress is inserting the <p> tags but I removed then did a “view page” => only content is page title (same as before).
Maybe I’m missing something in the process:
1. A form is submitted
2. An email notification is sent tp admin assist (for testing, me).
3. I refresh the CFDB form database. Submission is there. I do not see an added link column.
4. I update the “details” page. The Result is as above when viewed.Again, Thanks for your assistance with this. Hope to take the new site live this weekend.
You can try keeping WP from injecting the /P tag by have no RETURN after the “]” in your short code.
(3) Are you talking about the admin page? It is not going to be there. It should be on the master page wherein the link column gets dynamically generated by the [cfdb-table] short code. (Am I misunderstanding?)
- The topic ‘Change displayed wording of column headings Contact Form 7’ is closed to new replies.