• Resolved elestia

    (@elestia)


    Hi,
    I found these Plugin and it’s almost perfect. I just need to add some additional fields to the form. I Found these code, and it’s work, but its only for textarea: https://pastebin.com/4fvKErcp. I tried to change ‘type’ => ‘textarea’ for different field types (text_date, text_email etc.) but it didn’t work ??
    I know well HTML and CSS, but not javascript and PHP. I use Beaver Builder.
    I tried out many reviews plugin, but Site Reviews is so far the best for me – it would be perfect if there was a simple way to build the form.

    I need the form to look like this:

    1. Your overall rating —> it already exists by default
    2. Your Name —> it already exists by default
    3. Your Email
    4. Date (date-picker)
    5. Choose type (select with 2 options)
    6. Duration (input type=”text”)
    7. Description 1 (textarea)
    8. Description 2 (textarea)
    9. Description 3 (textarea)

    And I need to wrap them in HTML code, possible rearrange them (fields):

    <div class=”row”>
    <div class=”col-12 col-xl-6″>
    Fields 1-3
    </div>
    <div class=”col-12 col-xl-6″>
    Fields 4-6
    </div>
    </div>
    <div class=”row”>
    <div class=”col-xl-12″>
    Fields 7-9
    </div>
    </div>

    Can you please help me with it?

Viewing 15 replies - 1 through 15 (of 22 total)
  • Plugin Author Gemini Labs

    (@geminilabs)

    Adding custom fields to the submission form is not officially supported.

    However, the directions given in the link above covers everything you asked.

    To add a text field:

    $config['opinion'] = [
        'label' => __( 'Opinion', 'your_theme_domain' ),
        'type' => 'text',
    ];

    To add a date field:

    $config['opinion'] = [
        'label' => __( 'Opinion', 'your_theme_domain' ),
        'type' => 'date',
    ];

    To add a select field:

    $config['opinion'] = [
        'label' => __( 'Opinion', 'your_theme_domain' ),
        'options' => [
            'opinion_1' => __( 'Opinion 1', 'your_theme_domain' ),
            'opinion_2' => __( 'Opinion 2', 'your_theme_domain' ),
            'opinion_3' => __( 'Opinion 3', 'your_theme_domain' ),
        ],
        'type' => 'select',
    ];

    If you need to add any additional attributes to the field, simply add them to the array. If the attributes are valid for the field type, they will be added to the field:

    $config['opinion'] = [
        'autocomplete' => 'off',
        'data-foo' => 'bar',
        'label' => __( 'Opinion', 'your_theme_domain' ),
        'placeholder' => __( 'What is your opinion?', 'your_theme_domain' ),
        'required' => true,
        'type' => 'text',
    ];
    Thread Starter elestia

    (@elestia)

    Wow! That was superfast replay ?? Thank you!
    I will try this today and let you know.

    Thread Starter elestia

    (@elestia)

    Hi,
    It all work perfect!!! That’s amazing ??
    Now I need rearange fields into various column. I tried using css flexbox, but I need more classes.

    Is there a way to add custom css class to each form field?
    I want to add them in the same place as .glsr-field:
    <div class=”glsr-field my-custom-class-1“>
    … my form field …
    </div>
    <div class=”glsr-field my-custom-class-2“>
    … my form field …
    </div>
    etc.

    Plugin Author Gemini Labs

    (@geminilabs)

    To do this you can create a custom field template.

    Please see the, “How do I change the order of the review fields?” section on the Site Reviews > Documentation > FAQ page. The only difference is the name of the template used for the field which is: “/form/field.php”

    For example:

    /wp-content/themes/your-theme/site-reviews/form/field.php

    • This reply was modified 5 years, 8 months ago by Gemini Labs.
    Thread Starter elestia

    (@elestia)

    Ok, this time I don’t know how to do it right.
    I add field.php file and try to different variation:

    <div class=”glsr-field {{ class }} my-custom-class-1″>
    {{ label }}
    {{ field }}
    {{ errors }}
    </div>

    but this add exactly the same class to each fields. I need different for each fields.

    I tried to replace {{ label }} to {{ title }} or {{ opinion }} or {{ email }} – but it just repeat the same fields many times.

    I also tried something else – add my class in function php:
    ‘class’ => ‘my-custom-class-textarea’
    it works, but class is adding to <textarea> not <div class=”glsr-field “>.

    • This reply was modified 5 years, 8 months ago by elestia.
    Plugin Author Gemini Labs

    (@geminilabs)

    In that case, you can do this instead of using a custom template:

    https://pastebin.com/6ZHwa77Q

    Thread Starter elestia

    (@elestia)

    That worked :))
    Thank you so much! That plugin is great!!!
    I will give it max stars ??

    Can you please let me know how to rearrange some of the fields into various columns instead of using a custom template? This link is expired.

    https://pastebin.com/6ZHwa77Q

    Thank you

    Hello,
    Please, is it possible to tell me how to use the custom templates?

    Unfortunately the last link (https://pastebin.com/6ZHwa77Q) doesn’t work anymore ?

    Thank you ??

    Plugin Author Gemini Labs

    (@geminilabs)

    @justincode please see the Site Reviews > Help > FAQ page of the plugin.

    Hi @geminilabs, Thank you for creating this really nice plugin!! It worked really beautifully so far.But now i want to add and display two text type custom fields in my review section. I have checked and tested code from this link > https://pastebin.com/4fvKErcp But i gets the all the info like colors, opinion and ratings for personnal and service but it is not displaying that info inn reviews display at front end.
    Can you help me to know how can i add two text fields
    Your Country
    Your City
    and then display them at front end as well?

    Plugin Author Gemini Labs

    (@geminilabs)

    @wpbilal

    As explained in the pastebin link, support is not provided for adding custom fields. However, to show the custom fields in your reviews, please make sure to carefully read the comments of each snippet in the pastebin link:

    I have been able to add the new fields in the form submission but it wont show up. I had a look at the FAQs section but how do i create a new folder?

    “The first thing you will need to do (if you haven’t already) is create a folder in your theme called site-reviews. Once you have done this, copy over the review.php file from the “templates” directory in the Site Reviews plugin to this new folder.”

    I am using Divi theme.

    Plugin Author Gemini Labs

    (@geminilabs)

    @surathchandra15 since you are using Divi, you should use a child theme as otherwise any changes you make inside the Divi theme folder will be removed when Divi is updated.

    To learn how to make a child theme for Divi, please see: https://www.elegantthemes.com/blog/divi-resources/divi-child-theme

    Once you have done that, if you still need help on how to add a folder inside the child theme for the Site Reviews templates, let me know.

    Hello, Thanks for such a quick reply.

    I would like to know that I won’t be updating the divi theme anytime soon after the form has been done. So i think the child theme won’t be necessary.
    So can you help me do it inside the Divi main theme?

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘Additional fields in the Site Reviews form’ is closed to new replies.