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.

How to make submitted url automatically a link

  1. I've tried searching and can't find the answer to this. I'm hoping there's an easy way to make it so anytime a url is submitted it automatically makes it a link AND sets target to open a new window. Please and Thank You!

    Posted 13 years ago on Thursday November 18, 2010 | Permalink
  2. What are you referring to as far as a submitted URL? Are you referring to use the Content Template functionality on Post Fields and outputting the value of an Email field there?

    Posted 13 years ago on Thursday November 18, 2010 | Permalink
  3. Yes, using the Content Template on Post Fields and outputting a website address (not email, although I suppose I need the email to also be clickable). When the form is completed I want to be sure the pending post doesn't need any (or at least minimal) editing by the client. Thanks.

    Posted 13 years ago on Thursday November 18, 2010 | Permalink
  4. Currently there is no way to do this. The link field, like the email field, merely stores the address. So the variable simply outputs the data, which is a straight address.

    You would have to build the link yourself like so:

    <a href="{field variable:1}" target="_blank">{field variable:2}</a>

    We will look at enhancing the content template functionality on an ongoing basis. Automatically turning website and email fields into links probably won't happen because they then involve too many options (open in new window? target another window? whats the link title?), but what will is the ability to do conditional statements (ex. if statements) from within the content template. That is something we plan on adding.

    Posted 13 years ago on Friday November 19, 2010 | Permalink
  5. Thanks Carl. Sorry to be so lame but I'm a designer struggling to keep up with coding. So is that code something I'd add somewhere in GF or where? Would it be a one-time add to the template or need to be added for each form or what? Thanks!

    Posted 13 years ago on Friday November 19, 2010 | Permalink
  6. This is code you would add to the content template in the Post Body field where you want the link to be displayed. It would be added to each form that creates a post.

    Posted 13 years ago on Friday November 19, 2010 | Permalink
  7. gwc_wd
    Member

    I tried the href coding method and it returns an error:

    There was an error while saving your form, most likely caused by a plugin conflict. Please contact us and we will be happy to help you get this corrected.

    I have some link-related plugins but they are deactivated. Is it possible for them to interfere while inactive. I can have other html in the template such as without any problem. It only happens when I try to wrap a field in an href.

    Here's the code for the template: http://www.pastie.org/1359744

    The form page is at: http://saskmade.net/directory-entry

    Posted 13 years ago on Wednesday December 8, 2010 | Permalink
  8. @gwc_wd In order to determine why you are receiving the conflict error we will need a WordPress admin login for the site, and let us know what form is having the problem. You can send us this information to us via our Contact Us form and reference your post above.

    Posted 13 years ago on Wednesday December 8, 2010 | Permalink
  9. gwc_wd
    Member

    As always, I am enromously impressed with GF's (i.e. Carl <smile>) willingness to dig right in and help users.

    But, I have found the problem plugin. It's Event Manager Extended. I had problems with this plugin in the past but recent upgrades appeared to fix those incompatibilities. It must be something to with the way EME interacts with the post function.

    Your solution works perfectly with EME disabled.

    I want to replace EME with GF as well, but I don't see a way to automatically embed a location map (Google, MapQuest, wouldn't matter). Any ideas on that would be hugely appreciated.

    Does the output go thru other filters? I'm going to try to use an auto embed plugin in a form.

    Thanks, very much, for your fantastic work.

    Posted 13 years ago on Wednesday December 8, 2010 | Permalink