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.

Using the Create Content Template to conditionally populate data.

  1. I have a form with a choice radio button. I would like to populate the post body (using the "Create Content Template" option) based on the value of the radio button but instead of just plain text, I want to use an image, iframe, or other type of content.

    I would like to do something like this:

    if ( {Creative Commons Licenses:3} == "BY" ) [CC BY]
    else if ( {Creative Commons Licenses:3} == "BY-SA" ) [CC BY-SA]
    else if ( {Creative Commons Licenses:3} == "BY-ND" ) [CC BY-ND]
    else if ( {Creative Commons Licenses:3} == "BY-NC" ) [CC BY-NC]
    else if ( {Creative Commons Licenses:3} == "BY-NC-SA" ) [CC BY-NC-SA]
    else if ( {Creative Commons Licenses:3} == "BY-NC-ND" ) [CC BY-NC-ND]

    (Assuming the CC shortcodes can be translated into code that will insert the CC image tag and some text that describes the license type.)

    Does anybody have any suggestions how this can be accomplished?

    Thanks in advance,

    Jeremiah

    Posted 12 years ago on Monday April 16, 2012 | Permalink
  2. David Peralty

    You could adjust the post content using a custom function that hooks into the submitted data via gform_after_submission

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

    This would allow you to add in your image tag directly to the post content based on the selection from the radio choice button.

    Let me know if this helps.

    Posted 12 years ago on Monday April 16, 2012 | Permalink
  3. This looks like what I'm looking for. I will have to investigate further how I would correctly implement this feature, but now I know where to look.

    Thanks David for the fast reply.

    Posted 12 years ago on Monday April 16, 2012 | Permalink