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.

Short Code Hooks

  1. Jive Software
    Member

    Are there any hooks for Gravity Short Codes? I would like to pass page variables to my forms so I can populate hidden fields for different types of tracking technologies...

    Or can some on point me to any online documentation on customizing Gravity Short Codes?

    Thanks!
    Steve

    Posted 12 years ago on Monday October 1, 2012 | Permalink
  2. David Peralty

    There isn't anything in the shortcode, but there is some PHP you can use to grab variables from other things to pre-populate hidden fields:

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

    Make sure you have allow dynamic population checked on any fields you want to have values pushed into.

    Posted 12 years ago on Monday October 1, 2012 | Permalink
  3. Jive Software
    Member

    Hi David
    Thanks... This helps... I can see this working for web service calls... I am having a hard time visualizing how to integrate your hook at the auther contribution level...

    Ideally for the future it would be great if we could hook into the short code so I can use the forms created on the forms menu as templates verse actual forms. The when the author adds the form to a post or page they can insert the short code like so:

    [gravityform id=1 name=Example Form title=false description=false ajax=false campaignId=123 campaignName="hello world" assetId="1245" assetName="hello world whitepaper" ]

    Posted 12 years ago on Monday October 1, 2012 | Permalink
  4. David Peralty

    If you want default values like that for certain hidden fields, you can do that in the form builder. But you are right, you can't do it in the short code currently. All my best!

    Posted 12 years ago on Monday October 1, 2012 | Permalink
  5. Jive Software
    Member

    I just learned from reading on another blog that i can just use "field_values", and then I check the prepolutate check box... =O)

    [gravityforms id=2 field_values='id=1234&name=test']

    Or if I want to get fancy embed a short code inside another short code...

    Posted 12 years ago on Tuesday October 2, 2012 | Permalink
  6. David Peralty

    Be careful with the shortcode within a shortcode thing, as I think it can cause issues in certain cases.

    Also, make sure you have the populate dynamically selected on the fields you are going to push values to in this way. The field_values call is almost never used, hence why I blanked on that. Sorry!

    Posted 12 years ago on Tuesday October 2, 2012 | Permalink
  7. Hi!
    there is something i do not understand or not work properly.
    I need to populate dynamically an Hidden field with a shortcode.
    The shortcode in anypage seems to work and give me a number.
    But when i try the pre population seems to ingore it...

    Posted 11 years ago on Monday January 21, 2013 | Permalink
  8. @simmons: Closing this topic as a duplicate of the one you started here:
    http://www.gravityhelp.com/forums/topic/hooks-shortcode-to-populate-dynamically

    Posted 11 years ago on Monday January 28, 2013 | Permalink

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