Viewing 8 replies - 1 through 8 (of 8 total)
  • I was able to do this by modifying the file:

    I replaced all four instances of the line:

    jQuery(this).next().children().first().html('<?php echo __('File','itsg_gf_ajax_upload') ?>: <a target="_blank" title="<?php echo __('this link will open in a new window','itsg_gf_ajax_upload') ?>" href="'+file_url+'">' + file_name.substring(0,60) + ' ...</a>' );

    with:

    jQuery(self).next().children().first().html('<img src="'+file.url+'"/>' );

    And a little CSS tweaking to remove the green background to the containing div.

    FYI, there’s nothing here to hang onto the display of the preview image. So if you should submit the form without completing all the required fields, you lose the thumbnail. Shouldn’t be too hard to fix, but I thought I should disclaim that the above is a quick-and-dirty tweak, but may not be robust enough to rely on…

    Plugin Author ovann86

    (@ovann86)

    Hey,

    I’ve pushed out version 1.2.0 that includes an option in the backend settings to enable thumbnails.

    So far it’s just thumbnails for the form user, not for the backend/notifications/generated PDF’s using the Gravity PDF plugin.

    Im interested in feedback, see how it can be refined.

    Do you think thumbnails should be displayed in the backend as well?

    It’s highly likely you will need to customise your CSS to control how the thumbnails are displayed. I dont think this is something I can predict because it depends so much on what your theme’s CSS is.

    Let me know how you go with it and if you have any thoughts.

    Thread Starter Md Akter Hosen

    (@tareqhi)

    Hi Ovann86,
    Thanks for adding this option. But i noticed that it is a global option of site. How if i want preview on 1 field and i don’t want preview on other fields?

    Plugin Author ovann86

    (@ovann86)

    Im only going to do it globally, settings on a per-field basis are out of scope of this plugin for the medium term. To do this I would have to do a significant re-write of the plugins PHP and JavaScript.
    If you think you can do it or want to pay for a developer to do it I’ll consider adding it into the plugin so others can benefit from the feature.

    Thread Starter Md Akter Hosen

    (@tareqhi)

    Thanks a lot. I will email you as soon as I do.

    Hi. Im using your plugin with woocommerce. The thubnail displayed in the cart, but it not displayed from /my-account/view-order/
    https://prntscr.com/agcm7h

    Plugin Author ovann86

    (@ovann86)

    r0manenk0 – The ‘WooCommerce – Gravity Forms Product Add-On’ is a premium plugin, one I dont know anything about and don’t have a copy of.

    I suggest you speak with the woocommerce support team.

    You used to be able to run a filter to stop HTML from being stripped, but I’m not sure if this is still the case or the solution for you.

    It was something like this

    add_filter( 'woocommerce_gforms_strip_meta_html', 'configure_woocommerce_gforms_strip_meta_html' );
    function configure_woocommerce_gforms_strip_meta_html( $strip_html ) {
        $strip_html = false;
        return $strip_html;
    }

    Let me know if you can find out what’s needed to make this work with woocommerce so I can let others know if they ask.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Preview option’ is closed to new replies.