CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Printer-Friendly CiviContribute Pages
Pages: [1]

Author Topic: Printer-Friendly CiviContribute Pages  (Read 1707 times)

chapmanla

  • I post occasionally
  • **
  • Posts: 43
  • Karma: 1
  • CiviCRM version: 4.3.1
  • CMS version: Joomla 2.5.11
  • MySQL version: 5.0.95
  • PHP version: 5.2.5
Printer-Friendly CiviContribute Pages
November 07, 2009, 09:10:32 am
Is there a reason that front-end CiviContribute pages do not use a printer-friendly format for printing.  When a member elects the "Pay Later" option, I would like the member to print out the filled-out contribution form and send it with his check.  Unlike other CiviCRM pages, clicking on the Print icon on the page produces a messy, entire web-page print.  I can print out a Profile page without any problem.

The Joomla demo appears to echo this issue.

Thanks for any insight.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Printer-Friendly CiviContribute Pages
November 08, 2009, 07:41:06 am

this seems to work on my mac:

http://joomla.demo.civicrm.org/index.php?option=com_civicrm&task=civicrm/contribute/transact&reset=1&id=1

Instructing your users to use the browser print button should also work

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

chapmanla

  • I post occasionally
  • **
  • Posts: 43
  • Karma: 1
  • CiviCRM version: 4.3.1
  • CMS version: Joomla 2.5.11
  • MySQL version: 5.0.95
  • PHP version: 5.2.5
Re: Printer-Friendly CiviContribute Pages
November 08, 2009, 02:23:25 pm
Lobo,

Thank you for the response.  Just to be clear, it is the printer-friendly process that I am looking for.  The print icon works but produces a page with menus, headers, etc.

Since the CiviContribute pages use Javascript (window.print) for printing, then it must be a Javascript processing error I am experiencing.  I have tested, however, on three different computers (2 Macs and a PC) and three different browsers - they all behave the same.  I can go to other sites that use the window.print() command and it provides a printer-friendly output - I just can't get it to work on my site or the CiviCRM demo site.

I can produce printer-friendly window for a CiviContribute page by adding "&snippet=2" to the url of a CiviContribute page (this emulates how a profile page handles printing).  I am not sure how "snippet=2" actually works.  Although the window produced is printer-friendly (e.g., no menus), I get mostly a blank page if try to print it.

This is from the Joomla demo for a Profile Page:

Code: [Select]
<div id="printer-friendly"><a href="/index.php?option=com_civicrm&amp;task=civicrm/profile/view&amp;option=com_civicrm&amp;view=Profiles&amp;layout=search&amp;Itemid=7&amp;id=39&amp;snippet=2" title="Printer-friendly view of this page."><img src="/administrator/components/com_civicrm/civicrm/i/print-icon.png" alt="Printer-friendly view of this page." /></a></div>

versus the CiviContribute Page:

Code: [Select]
<div id="printer-friendly"><a href="javascript:window.print()" title="Print this page."><img src="/administrator/components/com_civicrm/civicrm/i/print-icon.png" alt="Print this page." /></a></div>

Please note that I forced the public display of the Test Profile Page I put on the demo by adding "&id=39" to the url.

I apologize in advance if I'm wasting anyone's time by trying to solve what is a local computer issue but appreciate any insight.
« Last Edit: November 08, 2009, 02:59:57 pm by chapmanla »

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Printer-Friendly CiviContribute Pages
November 09, 2009, 08:40:13 am
For most CiviCRM pages, we can provide the snippet=2 parameter which actually reloads the page in the browser with a different layout - excluding all the stuff the surrounds the main CiviCRM content (like menus, right/left columns etc.).

HOWEVER, for the CiviContribute Thank-you page we haven't figured out a way to do this since we explicitly blow away the session as soon as the contribution is successfully submitted and the thank-you page is displayed (this is to prevent accidental duplicate submissions of the contribution info as well as for security reasons). Hence, the best solution we have so far is to simply offer the basic javascript window.print on the page that is currently displayed in the browser.

I think there's potentially some stuff that could be done with css to implement a print stylesheet for that page that would hide other things - but there might not be a way to generalize given the variety of themes and layouts?? If you have skills / resources to investigate and submit a patch to improve this - that would be great.
Protect your investment in CiviCRM by  becoming a Member!

chapmanla

  • I post occasionally
  • **
  • Posts: 43
  • Karma: 1
  • CiviCRM version: 4.3.1
  • CMS version: Joomla 2.5.11
  • MySQL version: 5.0.95
  • PHP version: 5.2.5
Re: Printer-Friendly CiviContribute Pages
November 09, 2009, 05:12:18 pm
Thanks Dave for your response.

At some point in my life, I hope to become expert enough to make the kind of contribution you suggested.  I really do appreciate all of the hard work that goes into CiviCRM and would like to contribute to it (in addition to monetary contributions).

One question:  Would it be possible to use the snippet approach for CiviContribute pages that precede the Thank You page (before the contribution is submitted)?   In my case, I was asking members to print the page before submitting.  I am not exactly clear if the forms generated for these preceding pages use the same template as the Thank You page.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Printer-Friendly CiviContribute Pages
November 09, 2009, 07:17:45 pm

it is possible to do so, but a bit non-trivial. all the 3 pages share the same "url" and hence u'll have to examine the POST/GET params to figure out what page it is and what type of "print" button to display (javascript or snippet=2)

u'll need to be know your way around php and civicrm templates to make this change

lobo

A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

aspagarino

  • I post occasionally
  • **
  • Posts: 89
  • Karma: 10
  • San Diego Joomla
    • California Center for Sustainable Energy
  • CiviCRM version: CiviCRM 4.3
  • CMS version: Drupal 7
Re: Printer-Friendly CiviContribute Pages
January 27, 2010, 06:45:41 pm
Sorry about jumping into this post after a while but I am curious is chapmanla got this solved.

I am learning my way around civicrm templates, but I am not sure how to follow Lobo's instructions for getting snippet=2 on the contributions thank you pages... I believe they are only called on the preview header.

Andres

Open Source is Green

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Printer-Friendly CiviContribute Pages

This forum was archived on 2017-11-26.