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.

Conditional Text

  1. jenbaccellieri
    Member

    I have a conditional Yes/No question on this page: http://www.sweetenitwithagave.com/submit-recipe/ "Is this a revision of a previous recipe?"

    I would like it so that if you select Yes, the field names for the following two selections appear with its value when the post is published. As it stands now, I have the Field Name in the content template, so even if someone selects No, the field name appears without a value. Is there a way to include the Field Name or any other text within this shortcode {Which One:16}? That way, it only appears if the condition is met.

    Posted 14 years ago on Thursday April 7, 2011 | Permalink
  2. danielpettifer
    Member

    Use conditional logic:

    http://www.gravityhelp.com/documentation/page/Enable_Conditional_Logic

    Posted 14 years ago on Thursday April 7, 2011 | Permalink
  3. jenbaccellieri
    Member

    Thank you Daniel. I am already able to set up the fields and they work perfectly fine. The issue is displaying text next to the value. I would like for text, such as the field name to be included with the conditional value. Is that doable?

    Posted 14 years ago on Thursday April 7, 2011 | Permalink
  4. danielpettifer
    Member

    Unfortunately I have no experience with using a form submission as post information.

    Posted 14 years ago on Friday April 8, 2011 | Permalink
  5. @jenbaccellieri I'm not sure what you mean by text being included with the conditional value. Can you provide more details?

    Posted 14 years ago on Friday April 8, 2011 | Permalink
  6. jenbaccellieri
    Member

    @Carl Hancock I will try my best. I have a form for my users to fill out that submits their own recipes to my website. I also have a conditional Yes/No field, "Is This a Revision of A Previous Recipe?" When someone clicks Yes, a text field appears with the title "Which One?"

    But when the form is submitted, I would like the field title to appear as well. Is there a way to make that happen in the content template? This is what I currently have in the content template for that field: {Which One?:16}

    Is it possible to add the field title or some other text within those brackets?

    Thanks!

    Posted 14 years ago on Friday April 8, 2011 | Permalink
  7. You'd have to add the title, hardcoded in the template, with the variable for the field value. Right now the content template doesn't support conditional statements, but it is something we plan on adding in the future.

    Posted 14 years ago on Friday April 8, 2011 | Permalink
  8. jenbaccellieri
    Member

    Thank you Carl. If I do this, am I correct in assuming that the title will appear even if the conditional statement returns no, not triggering the text field?

    Posted 14 years ago on Friday April 8, 2011 | Permalink
  9. You are correct, that is what I was referring to being able to have conditional statements in the content template isn't currently supported but is something we plan on supporting in the future.

    Posted 14 years ago on Friday April 8, 2011 | Permalink
  10. jbdurand
    Member

    Hello Carl
    I am also desperately waiting for a conditionnal logic in the content template. Is it something that could appear soon in a beta version of GF?
    For the moment I am doing search and replace in posts using this plugin :
    http://wordpress.org/extend/plugins/search-and-replace/
    it's working (generating keywords in GF content template then replace them by html lines) and allows for exemple to insert images of selected items depending on user choices in forms menus.

    I

    Posted 14 years ago on Monday May 2, 2011 | Permalink