I created a custom template for my views (table) and I inserted a button below the table.

By clicking on that button I would like the table to be shown in a new page, from which that table can be printed.

Or to say it in another way: I want to embed to new page via such button.

How can I do this?


If I am interpreting this correctly, you want to click on a link and then have a page painted on your screen with JUST the view in it, no other blocks of information, just a clean display of the view information so the user can right click (or what have you) and then print this page and have it printed out without all that extra "stuff" on the page.

If that is correct, what you would need to do is:

  1. Have a link created in your table that links to another page, let's call it print/thisview.

  2. In the Views UI, create a duplicate page display that calls the view in question with print/thisview as the path.

  3. In your theme, create a page-print-thisview.tpl.php template that contains only the content region, none of the other regions.

  4. Clear all caches.

Now, if all is correct in the world, meaning I have oversimplified this a great deal, when you click on that link, it will paint the screen in a clean format that is nice for printing.

| improve this answer | |
  • yes that what i want, but i how can i make step 2(calls the view in question with print/thisview as the path.)? – abd Apr 9 '12 at 2:48
  • in the same place where you created your view, you create a page display and assign it a drupal path. then whenever you goto that path, the view is displayed on that page. – Jimajamma Apr 9 '12 at 17:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.