Beginner9
Forum Replies Created
-
Hi,
Here is the code for adding two custom fields, which I inserted in functions.php file
1. Custom select – City (Dropdown, not a ‘required’ field, only one selection allowed)
2. Custom checkbox – Choose Fabric (not ‘required’ field, multiple selection allowed)add_filter( "adverts_form_load", "my_adverts_form_load" ); function my_adverts_form_load( $form ) { if( $form["name"] != "advert" ) { return $form; } $form["field"][] = array( "name" => "my_custom_city", "type" => "adverts_field_select", "order" => 20, "label" => "City", "is_required" => false, "max_choices" => 1, "validator" => array( "options" => array( array("value"=>"1", "text"=>"Delhi"), array("value"=>"2", "text"=>"Mumbai"), array("value"=>"3", "text"=>"Alld"), array("value"=>"4", "text"=>"Varan"), ) ); $form["field"][] = array( "name" => "my_custom_fabric", "type" => "adverts_field_checkbox", "order" => 20, "label" => "Choose Fabric", "is_required" => false, "validator" => array( ), "max_choices" => 3, "options" => array( array("value"=>"1", "text"=>"Silk"), array("value"=>"2", "text"=>"Cotton"), array("value"=>"3", "text"=>"Woollen"), array("value"=>"4", "text"=>"Polyester"), ) ); return $form; }Next, I inserted the following code for display of fields in Ad Details page. Inserted again in functions.php file
add_action( "adverts_tpl_single_details", "my_adverts_tpl_single_details" ); function my_adverts_tpl_single_details( $post_id ) { $cf = get_post_meta( $post_id, "my_custom_city", false); $cc = get_post_meta( $post_id, "my_custom_fabric", false); ?> <?php if(! empty($cf) ): ?> <div class="adverts-grid-row"> <div class="adverts-grid-col adverts-col-45"> <span class="adverts-round-icon"></span> <span class="adverts-row-title">City</span> </div> <div class="adverts-grid-col adverts-col-90"> <?php esc_html_e( join(", ", $cf) ) ?> </div> </div> <?php endif; ?> <?php if(! empty($cc) ): ?> <div class="adverts-grid-row"> <div class="adverts-grid-col adverts-col-45"> <span class="adverts-round-icon"></span> <span class="adverts-row-title">Choose Fabric</span> </div> <div class="adverts-grid-col adverts-col-90"> <?php esc_html_e( join(", ", $cc) ) ?> </div> </div> <?php endif; ?> <?php }The ADD form works perfectly, however the ‘ad details’ page only shows values 1,2 etc. against these fields, instead of the actual text.
Many thanks for your support
Forum: Plugins
In reply to: [Contact Form DB] How to Display Individual Form Details from TableNoted & thanks, Michael.
Always appreciate your promptness & support.best regards,
Forum: Plugins
In reply to: [Contact Form DB] How to Display Individual Form Details from TableThanks for your reply, Michael.
Actually, I was not able to create the master-detail view for Form Maker. I replicated your code just like Contact Form 7, but could not find the tags for each field in Form Maker (You used tags for each field in the display page code for CF7, like first-name, last-name etc.)
[cfdb-html form="services enquiry" filter="submit_time=$_GET(st)"] First Name: ${first-name} <br/> Last Name: ${last-name} <br/> Address: ${street} <br/> City: ${city} <br/> State: ${state} <br/> Postal Code: ${postal-code} <br/> Country: ${country} <br/> [/cfdb-html]However, I could successfully replicate the same on Fast Secure Contact Form, where the visual appearance of the form is much better than CF7.
Am looking for support on two more things:
– Is it possible to improve the appearance of the table in Master view page.
Can some HTML/CSS be applied to make the table larger with borders/shading, as well as increase the font size of entries.– Also, can the entries on Master view page be subjected to any ‘Search/Filter’ operation through a plugin (For e.g., can I filter entries for a particular city or particular skill from the master page, rather than scrolling hundreds of entries to find an entry of my interest).
Many thanks in advance.
Kind Regards,
SK
IndiaForum: Plugins
In reply to: [Contact Form DB] How to Display Individual Form Details from TableHi Michael,
I tested the ‘Master Detail View’ with Contact Form 7 and it worked fine, just as you guided me.
However, I am not able to achieve the same with ‘Form maker’ plugin.
What I have done till now is this:
– pasted shortcode [cfdb-save-form-maker-page] on the page with the form, using a default form maker form [Form id=”1″]
– created master page and copy/pasted your code as guided with correct form name
– created detail page with link and copy/pasted code as guided for CF7.Your help will be highly appreciated.
Kind regards
Forum: Plugins
In reply to: [Contact Form DB] How to Display Individual Form Details from TableThanks, Michael.
That is a very detailed response (exactly something a non coder like me would expect), which is deeply appreciated.
Let me work on this and revert in case I run into some hurdles.
Cheers!
Forum: Fixing WordPress
In reply to: Forms Larger than 2 MB limitWow, it worked. Thanks a ton, mindctrl.