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.

Automatically place uploaded image in post

  1. Hi all

    Im pretty new to Gravity forms but its one amazing plugin so far!

    The only thing I am trying to do but failing miserably is auto posting uploaded images submitted by my users. I added an image upload field, the post is sent for approval then when I post it the image does not appear.

    What am I doing wrong here? I tried reading the documentation but idiotically I cant make sense of the tags and instructions.

    Also is it possible for users to upload a gallery of images?

    Any help much appreciated

    John

    Posted 12 years ago on Wednesday December 21, 2011 | Permalink
  2. Super, I got it working! I just needed to add <img src="image url here" /> to the submitted url meta key in my single.php template.

    How do I auto resize the image though? it coming through full size.

    Thanks
    john

    Posted 12 years ago on Wednesday December 21, 2011 | Permalink
  3. You could define a width on your <img> element. Are you using the Post Body field and then creating a template from that? That could be another option for you. Here is a good explanation for that:

    The Post Image field uploads the image to your Media Library and attaches the image to the Post that is created. The image isn't going to automatically show up in your post. For one we wouldn't know where it should be displayed or how it should be displayed.

    Just like if you go to your Media Library and upload an image, or go to Add New Post and click on the upload image icon and upload an image, they don't automatically get added into the Post Body of a post unless you insert it into the Post Body.

    If you want the image to be included in the post body then you need to edit the Post Body field on your form, turn on the Content Template option and then in the Content Template configure your post. Whatever appears in your Content Template is what will be used as the content of the post that is created, including any field merge tags you include. Merge tags are replaced by the actual fields value when the form is processed and the post is created.

    You can use the "Insert form field" drop down above the Content Template to insert form field merge tags. So using this functionality you can insert the merge tag for your Post Image field, including selecting which size from the Media Library sizes.

    Just remember that the Content Template overrides the Post Body field itself and whatever you configure in the Content Template is what will be used to create the content of the Post.

    The Content Template supports shortcodes so you can also include the [gallery] shortcode in the Content Template if rather than manually inserting a Post Image field merge tag you want to show a gallery of all the images that were uploaded with that Post.

    Posted 12 years ago on Wednesday December 21, 2011 | Permalink
  4. Wow, thanks Rob for the quick and detailed reply! All sounds good, ill have a go at that. My own method isnt working out as I expected unfortunately.

    Thanks!
    John

    Posted 12 years ago on Wednesday December 21, 2011 | Permalink
  5. Great, let us know how it goes!

    Posted 12 years ago on Wednesday December 21, 2011 | Permalink
  6. Hi Rob

    Thank you so much, that works like a dream! The only thing is the images are coming through full size and if someone uploads a large image, say 2-3mb then it slows the page load down. Any way to auto resize images? Also to set up the gallery as you mentioned, do i just add several upload image fields and they all combine in the post to create a gallery with the [gallery] shortcode?

    Thanks again
    john

    Posted 12 years ago on Thursday January 5, 2012 | Permalink
  7. When you choose the Post Image merge tag, it shows a drop down of what size you want to use:

    http://grab.by/bvxG

    Yes on the gallery question, that should work out.

    Posted 12 years ago on Thursday January 5, 2012 | Permalink
  8. Duh! How did i miss that. :-) Thanks man.

    I removed the post image merge tag & inserted [gallery] then uploaded an image but nothing came through?

    thanks

    Posted 12 years ago on Thursday January 5, 2012 | Permalink
  9. Hmm, that's odd. The [gallery] shortcode is built in WordPress gallery functionality for any photos attached to the page or post. It is designed to do exactly what you describe. Display any images associated with the post as thumbnails wherever you insert the shortcode.

    You can read more here:

    http://codex.wordpress.org/Gallery_Shortcode

    Your theme may or may not support the [gallery] shortcode out of the box, it may require CSS adjustments. It just depends if the theme developer took the time to properly style this or not. Most good themes do.

    Let me know if any of that info helps/changes anything for you.

    Posted 12 years ago on Thursday January 5, 2012 | Permalink
  10. Thanks Rob. Just realised I was using the file upload instead of the post image. Thats why it didnt work. Its working now but on the category page you can see the gallery css in the excerpt. Then when I go in to the post and click on the gallery thumbnail it doesnt pop up but takes me to this page (screenshot) http://eggdesign.ie/error.png

    Posted 12 years ago on Thursday January 5, 2012 | Permalink
  11. Woo hoo! Got it working using your link above. Thansk again. I just added link="file" to [gallery] so it reads [gallery link="file"] and now the thumbnails pop up (im also using wp-prettyphoto)

    thanks for your help
    john

    Posted 12 years ago on Thursday January 5, 2012 | Permalink
  12. Awesome John, glad you got it working! Glad to help out!

    Posted 12 years ago on Thursday January 5, 2012 | Permalink
  13. Great plugin, loving it. Works great now but just one final thing, when im using gallery shortcode the images that pop up are huge. How do i set the post image upoads to link to a smaller image size as opposed to the full sized uploaded image? Hope that makes sense!

    Sorry this is the last thing! :-)

    Posted 12 years ago on Thursday January 5, 2012 | Permalink
  14. This is dependent on your gallery shortcode. Are you using the built in gallery shortcode?

    Here is documentation on the built in gallery shortcode:
    http://codex.wordpress.org/Gallery_Shortcode

    Posted 12 years ago on Friday January 6, 2012 | Permalink
  15. Yep I used that but is that not for the thumbnail size? Perhaps I need to regenerate thumbnails to see the changes?

    Posted 12 years ago on Friday January 6, 2012 | Permalink
  16. If you changed image sizes, then yes, you need to regenerate thumbnails.

    Can you post a link to your page where the gallery exists. This might be WordPress functionality that you will need to modify.

    Posted 12 years ago on Tuesday January 10, 2012 | Permalink
  17. Thanks Ill try that. The site is "under construction" at the moment so only accessible through admin.

    Posted 12 years ago on Wednesday January 11, 2012 | Permalink
  18. John, I just ran across this post which may be helpful too, to have more control over the gallery output.

    http://digwp.com/2009/08/awesome-image-attachment-recipes-for-wordpress/

    Posted 12 years ago on Sunday January 15, 2012 | Permalink
  19. Cool thanks mate

    Posted 12 years ago on Wednesday February 22, 2012 | Permalink
  20. Great Post, very useful !!

    The customization possibilities of the wp gallery are not really good. Is there a way to show the upload images in another way such thickbox or fancybox, slideshow, etc..

    I use Nextgengallery but If any body knows other wordpress plugin for image that feeds perfect with gravity it will help a lot.

    With gallery shortcodes only can define columns of the gallery and image sizes but its not so cool the way the gallery is displayed.

    Thanks again, great plugin

    Posted 12 years ago on Thursday March 8, 2012 | Permalink
  21. Hi I agree this is a great post, and it seems like I am not the only one trying to acheive having user upload their photos to posts.

    I am running into some issues. I've added a form including the post image, post title, post category, and post body fields. I've added the merge tag for post image into the post body field, however, my images are still not showing in the post on the site... any idea as to what I might be doing wrong?

    Also, would there be any way to add the image as the "featured image" for the post? and/or in the post excerpt?

    Thank you so much for your help!!!

    Posted 12 years ago on Wednesday May 16, 2012 | Permalink
  22. Okay I apologize, I dont know how I missed the featured image checkbox in the post image field before. I got that part down. The one thing I am still missing however is I am trying to make it so that only registered users of the site can submit to the form. I'm looking for the answers in the support but havent found it yet. thanks again for your help!!!

    Posted 12 years ago on Wednesday May 16, 2012 | Permalink
  23. Okay, again, my apologies. I found it! Love love love this plugin!!!!

    Posted 12 years ago on Wednesday May 16, 2012 | Permalink

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