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.

Embed form via title

  1. paddelboot
    Member

    Hello,

    The gravity_form() function should accept the form ID OR the form title as a parameter to embed a specific form.

    Background: I am developing on my local machine, uploading recent updates to my client's server. The form IDs on both systems do not correspond, which creates the need to update PHP files on the server all the time. And no, I do not want to use the shortcode from within the editor.

    Thank you,

    Paddelboot

    Posted 12 years ago on Wednesday July 11, 2012 | Permalink
  2. Moved to feature requests.

    Related:
    http://www.gravityhelp.com/forums/topic/using-form-title-instead-of-id-when-embedding-in-templates

    Posted 12 years ago on Wednesday July 11, 2012 | Permalink
  3. paddelboot
    Member

    Also, since my forms are very complex and need constant improvement, to sync them with the online forms, I have to first duplicate them, delete the old one, rename the new one, and export it to the live system, since there is no way to somehow copy/paste a form.

    Paddelboot

    Posted 12 years ago on Monday July 16, 2012 | Permalink
  4. Fair points. I run into many of the same issues with my forms. Thank you again for the suggestions.

    Posted 12 years ago on Monday July 16, 2012 | Permalink
  5. paddelboot
    Member

    I now have 12 forms, and counting. I need to sync them all... Looking forward to any improvements on this matter, or any known workarounds. What about synching database fields: would it work to simply update the wp_rg_form_meta fields on the live server?

    Paddelboot

    Postscript: I exported said table and imported it on my live server, no problems so far.

    Posted 12 years ago on Wednesday July 18, 2012 | Permalink
  6. +1 for this feature request.

    Posted 12 years ago on Thursday October 18, 2012 | Permalink
  7. Also +1 for this feature request.

    Posted 12 years ago on Thursday October 18, 2012 | Permalink
  8. This should already be possible.

    The Gravity Forms shortcode supports displaying a form via the form name and NOT the id if that is what you want to do... so i'm assuming the function call also supports this because the shortcode uses the function call. HOWEVER i'm not 100% sure of the syntax because i've never done it this way.

    I'm going to ping our lead developer and have him provide details on how to do this.

    Posted 12 years ago on Wednesday October 24, 2012 | Permalink
  9. Yes, this is currently possible. Simply pass the form title instead of the form ID to the gravity_form() function call. I have updated the following documentation to reflect this change.
    http://www.gravityhelp.com/documentation/page/Embedding_A_Form#Function_Call

    Posted 12 years ago on Thursday October 25, 2012 | Permalink
  10. paddelboot
    Member

    Thanks for this update. One drawback is that I would have to update all my custom validation hooks aswell, since they are using the form id:
    add_filter( 'gform_field_validation_11_10', array( $this, 'validate_numbers' ), 10, 4 );
    In other words: having different form ids on the live and the development system can be confusing and time consuming.
    So for now I just stick with exporting the database table, which is fast and works fine.

    Thanks, Paddelboot

    Posted 12 years ago on Monday October 29, 2012 | Permalink

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