Hey folks, I think I’m very close to getting this to work, but I am baffled by the order of the templates as explained in the documentation, and how you are supposed to call the pop up, etc.
I think the docs might also need an example of the flow of templates (with a diagram) in addition to the usage of the tags and their parameters.
Here’s what I am doing:
I’m creating an ‘add image’ form for a weblog-based image gallery. What I thought the sequence was, looked like this:
1) An “upload file” template, a single-field form that asks you to browse for a file.
2) A “stand alone entry form (SAEF) template” that you get returned to after a successful upload.
What I thought would happen would be that template 1 (using the file_upload tag and its field_name parameter) would transer the uploaded file’s vital details to a field in the SAEF in template 2.
However this doesn’t work… while template #1 works great (it successfully uploads to the required directory), it doesn’t transfer anything to the form on template #2.
So what I understand now is that you are supposed to create some kind of popup? But which comes first, your SAEF or your file upload? Where does the file_confirm come in?
Is the template sequence supposed to be as so?
Template 1) SAEF form with an “upload file” button
Template 2) “Upload file” button opens a pop-up window which contains template #2, the file_upload template.
Template 3) After successful upload, user “confirms” the upload with another template that opens in the pop-up window after the successful upload (why is this necessary?) and closing the window with the button places the file reference back in a field in template 1).
Or is the SAEF supposed to be in the popup window? Help, confused…
If it’s like this, how do I get the original popup to work?
Here’s what my Template #1 looks like:
<h5><b>Step 1 of 2</b></h5>
{exp:file_upload:upload_form form_name="entryform" destination="Fan Gallery folder" field_name="image_file" return="fans/add_image_details"}
<p>Browse for the image on your computer that you would like to upload.</p>
<p><input class="filebrowser" type='file' name='userfile' /> </p>
<p class="formcaption">Your image has to be no more than 750 pixels wide, and no more than 600 pixels tall.</p>
<input type='submit' value='Upload' />
{/exp:file_upload:upload_form}
and Template #2:
<h5>Step 2 of 2: Add details for the image</h5>
{exp:weblog:entry_form weblog="{my_weblog}" return="fans/add_image_details" return="fans/add_image_details" status="Draft"}
<p>* Title<br />
<input type="text" class="input" name="title" id="title" value="" size="50" maxlength="100" onkeyup="liveUrlTitle();" /></p>
<p class="formcaption">Give your image a title.</p>
<p>* Gallery section<br />
{category_menu}
<select name="category[]" class="select">
{select_options}
</select>
{/category_menu}
</p>
<p class="formcaption">Which gallery are you posting this image in?</p>
<p>* Large Image filename:<br />
<input type="text" dir="ltr" name="field_id_72" class="input" value="" maxlength="256" size="50" onclick="setFieldName(this.name)" /></p>
<p class="formcaption">The file you just uploaded.</p>
<p>Image Caption:<br />
<textarea name="field_id_73" class="textarea" dir="ltr" cols="50" rows="6" onclick="setFieldName(this.name)"></textarea></p>
<p class="formcaption">Give the image some backstory or some details.</p>
<!-- other custom fields -->
<input type="submit" name="submit" value="Preview this info">
{/exp:weblog:entry_form}
As you can see, what I’m expecting is that the first template drop the info into field_id_72 on template #2, the input field for the image_file custom field in the weblog. But that’s not what’s happening.
Thanks so much for your help!! Like I said, I have it very close I think.
