I apologize if the question has already been asked and answered. I tried to search for similar questions/answers but the forum doesn't let me view replies so I'm afraid I have to ask (again). Is it possible to upload an image through GF, then have it automatically attach to the post, and most importantly have it go to a fixed location (e.g. top-left corner) in the post content? Basically, I'm looking at GF as a way to streamline the blog posting process for our not-very-computer-savvy writers. Thanks.
upload an image then add it to the post automatically
(9 posts) (8 voices)-
Posted 2 months ago | Permalink
-
While it is possible to have an image upload be attached automatically to the post (it is added to the gallery for the post that is created), it isn't currently a feature to have it automatically appear in the post content. This can be accompolished by using the available API hooks and writing some custom PHP.
We do have plans for adding the ability to completely control the post body in an upcoming release. We will enable you to use form field variables in the post body so you can output ANY form field value in the post body, including non-post form fields and images. This is going to make the post creation capabilities much more powerful. This won't be in the next release that we are wrapping up now but will be in the release after that.
Posted 2 months ago | Permalink -
I have a use for the same feature, so I will be looking forward to that future release.
Posted 2 months ago | Permalink -
In response to Carl:
"This can be accompolished by using the available API hooks and writing some custom PHP. "Can you give an example of the use of those API hooks?
This could be the answer I am looking for: in this threadI found the documentation about hooks and filters, but it is not comprehensive is it ?
--
ErwanPosted 1 month ago | Permalink -
Hello PaulFrank,
To answer your question, don't buy Gravity Forms.What your describing is a feature a lot of people want. Personally, I think GF has some misleading information on their features page in relation to the way images are handled, it's certainly not a feature as much as a beta feature.
GF will not automatically insert an image into a post. The PHP and API calls Carl Hancock is talking about are way above the technical knowledge of most people. He has been talking about this feature "coming soon" for at least 5 months now, so don't hold your breath.
http://forum.gravityhelp.com/topic/post-attachments-premium-add-ons#post-3134Of course they want you to buy this software, so they will say it's possible, but what he means to say is "If you can code PHP and know our plugin's code, then you can do it". But if you could code PHP, you probably wouldn't be buying this plugin would you?
What you can do, is have a user upload 1 image per input button, and then you'd have to manually go into the post using Wordpress and place the image in the post. If you want to do multiple image uploading, you'd need to give the user multiple image upload buttons (so 10 uploads would require 10 buttons on the page). Like I said, it's not really a flushed out feature.
If you can wait for the "future release" then I'd do that.
Posted 1 month ago | Permalink -
@drewbaker
I totally disagree that the information on the Gravity Forms site is misleading by any means. Also, this pre-sale question forum exists entirely to answer questions and provide clarification for potential Gravity Forms customers. You could have asked questions here before your purchase if you wanted to and we would have gladly helped clear things up for you.
We absolutely don't have any desire or need to mislead people simply to make a sale as you've implied. We would rather have well-informed, happy customers.
The site states that you can upload images to a post. The fact is that you can upload photos and they WILL be added to the media gallery for that page/post. If you simply wanted to show the photos in a gallery format, you could do so by using the built in gallery function in the post body. If you're creative, you can style the gallery itself for different layouts or limit the display to a single image and not have to manually add images.
http://forum.gravityhelp.com/topic/using-form-to-submit-blog-data#post-1822
The site never states that there is currently any advanced post templating features or implies that advanced layouts are fully automated.
Gravity Forms makes it easy for users to upload an image when creating a post via a user submitted form. Great for user submitted articles, directory sites, etc.
Yes, if you have a good understanding of PHP, you can do some of this yourself now with the existing hooks and filters and for the record, we have many accomplished programmers among our clients not in small part because they recognize the amount of work that's gone into the product.
That said, we know that people want more advanced options built into the UI and we're actively working on post templating functionality. Yes, people have been asking for it since day one, as with many other features like multi-page forms, etc. but the fact is it takes time to get these things built properly and some will naturally take priority over others. Gravity Forms still isn't a year old yet so we've come a long way, but still have tons of features we want to add.
The fact is, the plugin does what we say it does and we stand behind that.
It's apparent you've been waiting for the feature, and I can assure you that I've seen it and it's coming down the pipe very soon but you're going to have to continue to be patient.
--------------------------------------------------------------------------------------------
@paulfrank
If you wanted to display just one image, for now, you could use something like this to grab the image from the post gallery, then display it in your post template wherever you would like.
http://www.wprecipes.com/how-to-get-the-first-image-from-the-post-and-display-it
Again, more advanced functionality IS on it's way, but depending on your needs, you still have some options to get it done.
--------------------------------------------------------------------------------------------
@Strada
We're going to roll out an entirely new documentation section in the next couple of weeks. Alex has already documented all of the hooks and filters very thoroughly for this new wiki and I'm sure you and many others will find it very helpful. We still have some sections to finish, but it's nearing completion and we'll get it all published asap.
Posted 1 month ago | Permalink -
Hi Kevin,
let me add one more thing regarding your link 'Using Form to submit blog data' and how to include an uploaded image.
Just in case that you don't want to include a single image as a gallery, you can use the following code:
add_action("gform_post_submission", "post_submission_handler"); function post_submission_handler($entry){ $post_id = $entry[ 'post_id' ]; $imagepost = get_post($post_id); $arrImages =& get_children('post_type=attachment&post_mime_type=image&post_parent=' . $post_id ); $arrKeys = array_keys($arrImages); $objectID = $arrImages[$arrKeys['0']]->ID; $imageObject = wp_get_attachment_image_src( $objectID, 'large' ); $originalContent = $imagepost->post_content; $imagepost->post_content = '<img src="' . $imageObject[ 0 ] . '" alt="' . $imagepost->post_title . '" class="whatsoever" />' . $originalContent; wp_update_post( $imagepost ); }Chris
Posted 1 month ago | Permalink -
Nice. Thanks Chris.
Posted 1 month ago | Permalink -
Chris Grossmann: Your code works perfectly and can be added to custom.php in wp-content to avoid theme upgrade issues.
Thank you for the code!
Posted 2 days ago | Permalink
Leave A Reply
You must log in to post.