Skip to content

Instantly share code, notes, and snippets.

@jarrettbarnett
Last active January 31, 2017 22:44
Show Gist options
  • Save jarrettbarnett/1a682e489e486e92f676b16a4d3a9607 to your computer and use it in GitHub Desktop.
Save jarrettbarnett/1a682e489e486e92f676b16a4d3a9607 to your computer and use it in GitHub Desktop.
<!doctype html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Report Builder</title>
</head>
<body>
<section class="report-section">
<div class="text-block">
<h1>Report Builder</h1>
</div>
{exp:jb_attachpdf:get_entries entries="{segment_3}" prefix="jb" parse="inward"}
{exp:channel:entries limit="20" entry_id="{jb:entries}"}
<h1>{title}</h1>
{page_content}
{city_intro_content}
{city_sidebar_content}
{city_main_content}
{/exp:channel:entries}
{/exp:jb_attachpdf:get_entries}
</section>
</body>
</html>
<section>
{exp:freeform:form
form_name="contact"
return="site/report_builder"
notify_user="yes"
user_email_field="email"
}
<dl>
{freeform:all_form_fields}
{if freeform:field_type != 'hidden'}
<dt><label>{freeform:field_label}</label></dt>
<dd>{freeform:field_output}</dd>
{/if}
{/freeform:all_form_fields}
<input type="hidden" name="pdf_press_entries" value="{exp:cookie_fav:favourites}{if has_favourites}{favourites_entry_ids}{/if}{/exp:cookie_fav:favourites}"/>
<input type="hidden" name="pdf_press_template" value="site/email_pdf_report" />
<input type="hidden" name="pdf_press_upload_fieldname" value="report" />
<input type="hidden" name="pdf_press_filename_fieldname" value="report_filename" />
</dl>
{if freeform:captcha}
<p>Please enter the word you see in the image below:</p>
<p>
{freeform:captcha}
<input type="text" name="captcha" />
</p>
{/if}
<p>{freeform:submit}</p>
{if freeform:no_results}
<p>
Specified form was not found. Please make sure you have specified the
correct short name of the form in the <b>form_name</b> parameter.
</p>
{/if}
{/exp:freeform:form}
</section>
{!-- this tag takes a hyphen separated list of entry IDS and converts them to be pipe delimited --}
{exp:jb_attachpdf:get_entries entries="{segment_3}" prefix="jb" parse="inward"}
{jb:entries}
{/exp:jb_attachpdf:get_entries}
{!--
parameters:
entries (required): hyphenated list of entries, e.g. 5-13-17 (for entries 5, 13, and 17)
prefix (optional): the prefix to use (defaults to "jb" when not provided . Note that the colon is added automatically)
--}
@jarrettbarnett
Copy link
Author

Note that you'll probably want to create a new form (instead of Contact Us) and leave out the typical fields (First Name, Last Name, etc.) in lieu of just an Email field (to receive the emailed report).

I would also suggest creating a new "user notification" template that you can use to improve the user notification email.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment