PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Support for custom posts

  1. pfeatherstone
    Member

    Hi,

    I am looking at purchasing a gravity forms license but wanted to check a few things first (I wish to use on a mobile review site):

    1) Can forms be created to enable non-registered users to submit reviews in the form of custom posts?
    2) Is it possible to incorporate user rating into forms - specifically multiple star ratings (or similar graphical / icon based variation)?

    Thanks for your help.
    Regards,
    Paul

    Posted 12 years ago on Monday May 30, 2011 | Permalink
  2. Hi Paul,

    The answer to both questions is yes! Woohoo! On the first question... you will need to add a small snippet to your theme's functions.php to create the post as a custom post type. The snippet is freely available in forums for registered users. :)

    Posted 12 years ago on Tuesday May 31, 2011 | Permalink
  3. pfeatherstone
    Member

    Hi Dave,

    Good news, I have read lots of good things about gravity.

    I good to go with custom posts in functions.php as already have three set up as part of my custom theme.

    On question two, do you have any examples of the content rating I can take a look at? I specifically need ratings for users to submit as part of the custom form submission and then need to be able to display content based on rank (e.g. top ten ranked mobile phones).

    Thanks again.

    Paul

    Posted 12 years ago on Tuesday May 31, 2011 | Permalink
  4. Hi Paul,

    No specific examples come to mind. Gravity Form radio buttons support images for the labels so you can add an image for each radio button and then use a little CSS to hide the radio button itself.

    Gravity Forms does not handle how this information is displayed once the post is created.

    Posted 12 years ago on Tuesday May 31, 2011 | Permalink
  5. ebiansyah1402
    Member

    That's what I'm talking about!
    This is exactly what I need.

    Posted 12 years ago on Saturday June 4, 2011 | Permalink
  6. David - you mentioned, "Gravity Form radio buttons support images for the labels so you can add an image for each radio button and then use a little CSS to hide the radio button itself." Can you please advise what the "little CSS to hide the radio button itself" is and where I place it? I just want the use images for multiple choice selection without the little radio buttons displayed. Many thanks for a great product.

    Posted 12 years ago on Saturday July 23, 2011 | Permalink
  7. @baraka43 - to hide a radio button, you need this CSS:

    [css]
    .gform_wrapper ul.gfield_radio li input[type="radio"] {
    display:none;
    }

    Add that to your theme's style.css or custom.css if appropriate. That will hide the radio button.

    I added the images in the field labels like this:

    <img src="http://gravity.chrishajer.com/wp-content/themes/twentyeleven/images/flags/png/es.png" /> Spain
    <img src="http://gravity.chrishajer.com/wp-content/themes/twentyeleven/images/flags/png/cn.png" /> China
    <img src="http://gravity.chrishajer.com/wp-content/themes/twentyeleven/images/flags/png/us.png" /> United States
    <img src="http://gravity.chrishajer.com/wp-content/themes/twentyeleven/images/flags/png/ir.png" /> Ireland
    <img src="http://gravity.chrishajer.com/wp-content/themes/twentyeleven/images/flags/png/cg.png" /> Congo
    <img src="http://gravity.chrishajer.com/wp-content/themes/twentyeleven/images/flags/png/sn.png" /> Senegal

    (for usability, you might want to include alt tags. maybe dimensions too, for layout)

    You're going to want to check the box "enable values" as well, because without it, that full img tag will be the submitted value in your admin, which is probably not what you want. I entered values like this:

    Spain
    China
    USA
    Ireland
    Congo
    Senegal

    That's all I needed to do for the setup.

    That gave me a little bit of a usability problem though:
    http://gravity.chrishajer.com/2011/07/22/where-are-you-from/

    It's hard to tell which item was "selected" without the feedback of filling in the button. You might have to add some additional CSS or JavaScript to actually indicate which radio button (flag) was selected. Your use case may be different. If you need additional help beyond hiding the radio button, please let us know.

    Thanks.

    Posted 12 years ago on Saturday July 23, 2011 | Permalink
  8. Brilliant response, Chris. Thank you very much!

    Posted 12 years ago on Saturday July 23, 2011 | Permalink
  9. Cheers. Hope that works out for you.

    Posted 12 years ago on Saturday July 23, 2011 | Permalink
  10. You could use a sibling selector with CSS to change the color/font weight, etc. on the label when it's selected. That way you have some feedback with the radio button hidden.

    [css]
    body .gform_wrapper ul.gfield_radio li input[type="radio"]:checked+label {
        color: red;
        font-weight: bold;
    }

    screenshot: http://bit.ly/qQvCFL

    That should work in all of the modern browsers without having to use any scripting.

    Posted 12 years ago on Sunday July 24, 2011 | Permalink
  11. I updated my demo form with that CSS and it works great.

    http://gravity.chrishajer.com/2011/07/22/where-are-you-from/

    Thanks Kevin.

    Posted 12 years ago on Sunday July 24, 2011 | Permalink

This topic has been resolved and has been closed to new replies.