Forum OpenACS Q&A: Implementing "printer friendly" and "email this page" on ACS 3.4

We want a "email this page to a friend" icon that will send off an
email from the logged-in $email to an address of their choice, and a
"printer friendly version" icon to relax headers/footers/templating.

We use CSS and doc_return throughout the site, so I think it might be
as as simple as changing the template on demand. "Print" would be
accomplished with a vastly simplified template, "Email" with a form
that includes $body in a hidden post variable, or something.

But how do we get that information to the page? We're not going to
change every single ad_page_contract and I think master.adp is too
late to pass arguments (or is it?). Maybe a filter proc on URLs
starting with /print or /email? I (mostly) understand filter procs to
make completely virtual URLs (download, the classic bboard
search-engine-bait) or redirects (ad_partner), but how do I define
aolserver "Aliases" so that requests for /print/foo are handled by the
same file as requests for /foo?

This gets more interesting if we need to print URLs that are already
handled by virtual filter procs. We'd "probably" want them nested in
the "right" order.

Other clever ideas? Again this is classic ACS 3.4.10.

Hi Rich.
About the email this page we have implemented it with openacs 3.2.x, we created a specific proc that we atach to the pages (just a few) that we want to be referred (check at lectario, is in spanish, the link says Enviar esta pagina a un amigo), I suggest you to attach the proc at the ad_header proc so it will automaticly get the url to be sent and maybe if you want to can save that email in the DB as we do in order to know what the users are liking. Its better to just send a link with a comment by the sender, so you gain another visitor, most of the sites with this feature does this, I know because before doing the module I seek for that.

For the print this page stuff you can do the next thing:
at ad_header add the following things:
something that grab the actual url and encode it to a new link with an extra variable, the magic one that will say to you if you want printer format.
Lets say you'll a new link like this:
<a href=the_actual_url?the_actual_vars...&print=true>print this page</a>
Now, you need to modify the ad_return_template proc, it needs to see if the print variable is set and it has a true value it will do the same is it does but redirect to a template that you define in your parameters file or inside the proc or wherever you want!

How do you look this?? I think this is a easy way to acomplish what you are looking for.

I hope this help!