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.

Prefill field based on NextGEN Download selection

  1. I am trying to DIY a NextGEN Gallery proofing solution. You can see what I've done so far here: http://scottwyden.com/proofing/example/

    I was thinking one way to do it is to have a Gravity Form take care of the Download Selected Images button and also email a list of selected images to me.

    Here is the code that drives the download part of the template:

    [php]
    <!-- Thumbnails -->
    	<form action="<?php echo admin_url('admin-ajax.php'); ?>" method="get" id="ngg-download-frm">
    		<input type="hidden" name="action" value="ngg-download-gallery-zip" />
    		<input type="hidden" name="gallery" value="<?php echo htmlspecialchars($gallery->title); ?>" />
    
    		<?php foreach ( $images as $image ) : ?>
    
    		<div id="ngg-image-<?php echo $image->pid ?>" class="ngg-gallery-thumbnail-box" <?php echo $image->style ?> >
    			<div class="ngg-gallery-thumbnail" >
    				<a>imageURL ?>" title="<?php echo htmlspecialchars($image->description) ?>" <?php echo $image->thumbcode ?> >
    					<?php if ( !$image->hidden ) { ?>
    					<img title="<?php echo htmlspecialchars($image->alttext) ?>" alt="<?php echo htmlspecialchars($image->alttext) ?>" src="<?php echo $image->thumbnailURL ?>" <?php echo $image->size ?> />
    					<?php } ?>
    				</a>
    				<label class="proof_download">Download<input type="checkbox" name="pid[]" value="<?php echo $image->pid ?>" /><span><h4><?php echo htmlspecialchars($image->alttext) ?></span></label></h4>
    			</div>
    		</div>

    I used http://wordpress.org/extend/plugins/nextgen-download-gallery/ to actually handle the downloads. Do you think it's possible to have GF's submit button handle trigger the download? And if so, do you think it is also possible to have a paragraph block pre-fill with the file numbers?

    Thanks for the help!

    Posted 12 years ago on Sunday September 2, 2012 | Permalink
  2. Not sure why the code got messed up - I used the backtick. Here is a pastebin version: http://pastie.org/4653017

    Posted 12 years ago on Sunday September 2, 2012 | Permalink
  3. Scott, you used the single quote rather than the backtick. Backtick is upper left on the keyboard, under the tilde usually.

    I see the example you have online now. That is *without* the Gravity Form? How does it look when Gravity Forms is involved?

    If a form is still being submitted, I am not sure how you can combined the form submission and triggering the downloads as well. How about using the confirmation page to offer the "download selected images" button? That way, your form submission still works, and the user still submits a form and can also download the selected images.

    Let me know if I am off base because I am not sure how Gravity Forms is involved in all this. Thanks.

    Posted 12 years ago on Monday September 3, 2012 | Permalink
  4. Right now GF is not on there as you mentioned. I was trying to see if this was even possible before experimenting.

    Posted 12 years ago on Tuesday September 4, 2012 | Permalink