Title: [Plugin: WordPress Form Manager] get image into template
Last modified: August 20, 2016

---

# [Plugin: WordPress Form Manager] get image into template

 *  Resolved [mastermillo](https://wordpress.org/support/users/mastermillo/)
 * (@mastermillo)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/plugin-wordpress-form-manager-get-image-into-template/)
 * Hi!
    I am searching a way to display an image within the template of Form Manager
   for displaying within the new generated post. With the default template a download
   link is generated, but I want to display the image of the file-input field.
 * I tried to use
    `fm_summary_get_item_value($nickname) - get an item's value by
   nickname`
 * but this delivers more information, not only the URL.
 * Any help is appreciated.
 * AM
 * [http://wordpress.org/extend/plugins/wordpress-form-manager/](http://wordpress.org/extend/plugins/wordpress-form-manager/)

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [hoffcamp](https://wordpress.org/support/users/hoffcamp/)
 * (@hoffcamp)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/plugin-wordpress-form-manager-get-image-into-template/#post-2281495)
 * Unfortunately the way the files work is kindof weird. The value returned by fm_summary_get_item_value()
   is an unserialized array containing the filename and other stuff. Try this instead:
 *     ```
       <?php
       $file = fm_summary_get_item_value('whatever');
       $file = unserialize($file);
       $uploads = wp_upload_dir();
       ?>
       <img src="<?php echo $uploads['url'].'/'.$file['filename'];?>"/>
       ```
   
 * This will only work if you are using %wp_uploads_dir% as the upload directory.
 *  Thread Starter [mastermillo](https://wordpress.org/support/users/mastermillo/)
 * (@mastermillo)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/plugin-wordpress-form-manager-get-image-into-template/#post-2281548)
 * Thank you! This works perfect.
 *  [grezliq](https://wordpress.org/support/users/grezliq/)
 * (@grezliq)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/plugin-wordpress-form-manager-get-image-into-template/#post-2281718)
 * Guys, I’m newbie in this kind of trics, so I would like to get some help.
 *     ```
       <?php
       /*
       Template Name: Form Manager Default
       Template Description: The default template for e-mail notifications and summaries
       Template Type: email, summary
   
       //////////////////////////////////////////////////////////////////////////////////////////
   
       Below are the functions that can be used within a summary template:
   
       fm_summary_the_title() - the title of the form
       fm_summary_have_items() - works like have_posts() for wordpress themes.  Returns 'true' if there are more items left in the form.
       fm_summary_the_item() - works like the_item() for wordpress themes.  Initializes the current form item.
       fm_summary_the_label() - label of the current form item
       fm_summary_the_type() - type of the current form item (text, textarea, checkbox, custom_list, note, separator, recaptcha, file)
       fm_summary_has_data() - returns true if the form element is a data element (as opposed to a separator, note, etc.)
       fm_summary_the_value() - submitted value of the current form item
       fm_summary_the_timestamp() - timestamp for the current submission
       fm_summary_the_user() - the login name for the current user.  If no user is logged in, this returns an empty string.
       fm_summary_the_IP() - the IP address of the user who submitted the form.
       fm_summary_the_nickname() - the current item's nickname
   
       fm_summary_get_item_label($nickname) - get an item's label by nickname
       fm_summary_get_item_value($nickname) - get an item's value by nickname
   
       *NOTE: 'Summary' templates can also be used for e-mails.  Notice that under 'Template Type', both 'email' and 'summary' are listed.  If you want to make a template for e-mail notifications only, then you should only put 'email' under 'Template Type'.
   
       //////////////////////////////////////////////////////////////////////////////////////////
   
       */
       ?>
       <?php /* The title of the form */ ?>
   
       <?php /* The user's first and last name, if there is a logged in user */ ?>
   
       <?php /* The code below displays each form element, in order, along with the submitted data. */ ?>
       <ul id="fm-summary">
       <?php while(fm_summary_have_items()): fm_summary_the_item(); ?>
       	<?php if(fm_summary_the_type() == 'separator'): ?>
       		<hr />
       	<?php elseif(fm_summary_has_data()): ?>
       		<li<?php if(fm_summary_the_nickname() != "") echo " id=\"fm-item-".fm_summary_the_nickname()."\"";?>><?php echo fm_summary_the_label();?>: <strong><?php echo fm_summary_the_value();?></strong></li>
       	<?php endif; ?>
   
       <?php endwhile; ?>
       </ul>
       ```
   
 * This is my fm-summary-default.php
    Where I have to paste this code and what is‘
   whatever’?
 *  Thread Starter [mastermillo](https://wordpress.org/support/users/mastermillo/)
 * (@mastermillo)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/plugin-wordpress-form-manager-get-image-into-template/#post-2281735)
 * Here is the example how I use it:
    – use it before the “loop” will give you only
   the image – using it within the “loop” will generate the image and the link to
   the file Hope that helps you!
 * _[Code moderated as per the [Forum Rules](http://codex.wordpress.org/Forum_Welcome#Posting_Code).
   Please use the [pastebin](http://wordpress.pastebin.com/)]_
 *  Thread Starter [mastermillo](https://wordpress.org/support/users/mastermillo/)
 * (@mastermillo)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/plugin-wordpress-form-manager-get-image-into-template/#post-2281738)
 * [code pasted here](http://pastebin.com/FG2arV2J)
 *  [cheefa](https://wordpress.org/support/users/cheefa/)
 * (@cheefa)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-wordpress-form-manager-get-image-into-template/#post-2281770)
 * mastermillo, you can upload the files necessary for work? or give the code with
   an explanation: 1) in which to insert the file 2) in a row insert?
 *  Thread Starter [mastermillo](https://wordpress.org/support/users/mastermillo/)
 * (@mastermillo)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-wordpress-form-manager-get-image-into-template/#post-2281771)
 * dear cheefa,
    everything you can do is described above or look in / use the pasted
   code (link) above your comment. should be selfexplaining….
 *  Plugin Author [hoffcamp](https://wordpress.org/support/users/hoffcamp/)
 * (@hoffcamp)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-wordpress-form-manager-get-image-into-template/#post-2281786)
 * I made a change in the file upload. The code to grab the file url is:
 *     ```
       <?php
       $file = fm_summary_get_item_value('whatever');
       $file = unserialize($file);
       ?>
       <img src="<?php echo $file['upload_url'].'/'.$file['filename'];?>"/>
       ```
   
 * Note that the url is stored with the file array, and there is no call to `wp_upload_dir()`.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘[Plugin: WordPress Form Manager] get image into template’ is closed to
new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wordpress-form-manager.svg)
 * [Form Manager](https://wordpress.org/plugins/wordpress-form-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-form-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-form-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-form-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-form-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-form-manager/reviews/)

 * 8 replies
 * 4 participants
 * Last reply from: [hoffcamp](https://wordpress.org/support/users/hoffcamp/)
 * Last activity: [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-wordpress-form-manager-get-image-into-template/#post-2281786)
 * Status: resolved