Jump to content

Recommended Posts

Posted

Hi!

I need an alternative rendering for my pages for printing.
In this case i can't do it with css but i need a special template or something for the print view.

How can i achieve this?

THANKS!

 

Posted

In your template file:

if($input->get('print')) {
	// Your special print-friendly markup here
} else {
	// Your normal markup here
}

In your normal markup include a link to the print-friendly view:

<a href="<?= $page->url ?>?print=1">Print-friendly view</a>

If you want to automatically open the browser's print dialog you can include this in your print-friendly markup:

<script>
	window.print();
</script>

 

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...