Jump to content


Photo

Easiest way to add "Print This Page"-link


  • Please log in to reply
8 replies to this topic

#1 karz

karz

    Etomite Forum Newbie

  • Member
  • 8 posts

Posted 25 July 2007 - 12:10 PM

I created "Printable Page" template and I can access the page typing http://www.mysite.com/page?printable

How do I add the "Print This page" most easily? Like bottom of every page. I cannot find any current document or any other variable to add page.

I am using AlexisPro Redux template. Thanks for help.

#2 Ralph

Ralph

    Loves Etomite Forums!

  • Admin
  • 6,539 posts

Posted 25 July 2007 - 01:27 PM

I use a snippet named Printable and just place the snippet call wherever I want the link to appear... The code the snippet contains is listed below... The theory behind the snippet is that you should have a template named Printable Page which is used for rendering the printable page... The parser looks for $_GET['printable'] and, if found, uses the Printable Page template for that particular page render... Because the snippet uses the makeUrl() API function call it works perfectly with or without FURL's enabled...

$url = $etomite->makeUrl($id=$etomite->documentIdentifier, $alias='', $args='?printable');
return "<a style='text-align:center;' href='".$url."' title='Display page in printable format'>Printable Page</a>";


#3 karz

karz

    Etomite Forum Newbie

  • Member
  • 8 posts

Posted 25 July 2007 - 07:01 PM

Thanks for this! :) I got this working. However, I'd got few questions about this one, hope you can help me :)

- Can I add comments (footer note) to printed pages? Like "This is printed from mysite.com"? So they wouldn't appear on normal pages but on printable.
- Can I add JS function or similar to make browser popup the printer window automatically? Without user pressing CTRL+P or choosing File -> Print.
- Is this normal that "Printable Page"-link is also displayed on the printable page itself - after I've pressed the "Printable Page"-link? Can I remove the "Printable Page" somehow when I am already on the printable page?

#4 Ralph

Ralph

    Loves Etomite Forums!

  • Admin
  • 6,539 posts

Posted 25 July 2007 - 07:32 PM

If you place the Printable page snippet call in your template instead of in your documents, then it won't be displayed...

You can edit the Printable page template to include whatever you want - within reason...

#5 katherholt

katherholt

    Likes Etomite Forums!

  • Member
  • PipPip
  • 323 posts

Posted 20 September 2007 - 12:57 AM

This works very nicely, Ralph. See example here:
http://www.roswellrotary.com/home.html
Karen

If you place the Printable page snippet call in your template instead of in your documents, then it won't be displayed...

You can edit the Printable page template to include whatever you want - within reason...



#6 Ralph

Ralph

    Loves Etomite Forums!

  • Admin
  • 6,539 posts

Posted 20 September 2007 - 01:30 AM

This works very nicely, Ralph. See example here:
http://www.roswellrotary.com/home.html
Karen

That's it, exactly... I use the snippet on my site, but only in specific sections - controlled by chunk based content templates...

#7 Rickyx

Rickyx

    Etomite Forum Newbie

  • Member
  • 38 posts

Posted 22 March 2012 - 07:49 PM

Anyone noticed that it works only for the default template?
With other templates it simply go back to the same template: that means that &printable has no effect.
...or I'm experiencing a weird bug?

Thank you for any advice you have to solve this problem,
Rickyx

#8 Ralph

Ralph

    Loves Etomite Forums!

  • Admin
  • 6,539 posts

Posted 23 March 2012 - 12:46 PM

I'll dig deeper but preliminary testing showed the flag to be working properly on my development install...

#9 Rickyx

Rickyx

    Etomite Forum Newbie

  • Member
  • 38 posts

Posted 24 March 2012 - 10:04 AM

Tell me if you need some more specifications or testing.
I can give you the link to the "accused" page or what else you need.

Thank you for your intervention,
Rickyx




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users