Start here for information about printing zwiki pages and entire wikis.

Printing tips


Discussion

Mathis Heydtmann suggested:

We're using a ZWiki at my work to manage various things. Among them is a morning meeting sheet, where everyone can place things that need to be discussed. This gets printed out just before the meeting, and was the occasion for some changes I made to our ZWiki installation.

  1. Added a folder named Printable to my ZWiki folder
  2. Gave it an attribute printable, boolean, value = 1
  3. Added a link to the small section in my header - Printable/ dtml-var id
  4. Wrapped a dtml-if around the contents of the standard_wiki_header and footer, dtml-if printable, put the original contents in the dtml-else, and put just the HTML, HEAD, and BODY statements in the dtml-if.

Now every page has a printable link which displays the page without any extra text. I did not try to trick the ZWiki into not parsing the page as a zwiki page though. [i.e. I didn't try to prevent the hyperlinking.]

ZwikiModification

What would be nice is a feature of print multiple pages: for example display the wiki hierarchy, have some tickboxes on the side and a print button at the bottom which allows to print several pages at the same time.

Mathis Heydtmann, August 22, 2002


There is another way to achieve the above described link for printing: edit the file wikipage_macros.pt on your local Zwiki-Installation.

Add the line <a tal:attributes="href string:${here/pageUrl}/print" accesskey="j">Print</a> just after the line that says "go to help page". I picked j as the access key, since almost all other letters are already in use.

--Benedikt


Simon Michael, 2002/08/22 15:55 GMT (via mail):
We discussed this recently - see eg http://zwiki.org/TestPage/print , print/view_source . Watch out it can be a resource hog on the server.


DeanGoodmanson, 2002/09/26 04:55 GMT (via web):
I ran into a case where the children didn't print. Too many variables: Changed ZWiki version and re-cataloged.

This may need conditional's placed around the standard_wiki_header/footer..., but in general, I chucked them because I didn't want them there in the fist place. I consider print a "printer friendly format".

Neat feature, I want to add an argument to not print the children, to be able to add a "printer friendly format" link to the controls.

dtml hassles trimmed

SimonMichael, 2003/01/20 03:46 GMT (via web):
I replaced PrintablePages and PrettyPrint with this one.

no children patch to print --DeanGoodmanson, 2003/03/23 04:21 GMT
I've modified the print method to:

I'll attach as as printNG01

Note: I don't like having to call ?with_children=1 , I would much rather simply ?with_children .. if someone can suplly the appropriate fix I'd like to implement that. An example for how to implement this on a page would be appreciated, as mine won't be built for many days. At first I was thinking a drop-down with the options, then I felt a printer icon to teh basic view, then built in the extra functions.

printNG01.txt

no children patch to print --SimonMichael, 2003/03/23 06:01 GMT
Nice, installed as print.

print and params --DeanGoodmanson, 2003/03/25 05:07 GMT
I was a bit surprised to find that the URL* var's don't contain the querie.

I need to learn a bit more about the querie, but there's a probem when trying to put this "print" button on an IssueTracker page. I can't easily flop the existing parameters without redundancies in the existing print parameters.

Thoughts? Any suggestions to "boolean" type parameters? I'd rather just ?with_children&no_printheader instead of having to add =1 on the query.

print and params --Simon Michael, 2003/03/26 16:18 GMT
zwiki-wiki@zwiki.org (DeanGoodmanson) writes:
> Thoughts? Any suggestions to "boolean" type parameters? I'd rather just
> ?with_children&no_printheader instead of having to add =1 on the query.

I haven't found a way.. I had to at least put "?with_children=".


comments:

print and special characters (German Umlaute) --Benedikt, Fri, 02 Apr 2004 05:47:40 -0800 reply
In the printable view, Umlaute won't display correctly. Anybody knows why, or how to alter this behaviour?

print and special characters (German Umlaute) --Simon Michael, Fri, 02 Apr 2004 09:33:46 -0800 reply
Benedikt wrote:

When including child-pages in the printable view, Umlaute won't display correctly. Anybody knows why, or how to alter this behaviour?

I don't see this, eg at i18n/print. Are you sure it's print-related ? Zwiki switched to utf-8 encoding around 0.27 and you may need to convert old latin-1 content, there is an issue with a procedure for this.

print and special characters (German Umlaute) -- Mon, 05 Apr 2004 04:08:40 -0700 reply
In fact it is rendered fine on the page you mentioned. Hence it seems to be a problem with my local installation (using ZWiki 0.28 and Zope 2.7). In the html-source (and also in the rendered html) of the ../print url "ä" is displayed as "ä". Without the "print" suffix it is displayed correctly. --Benedikt

print and special characters (German Umlaute) -- Mon, 05 Apr 2004 04:36:39 -0700 reply
Found the problem: In the head of the html-document produced by the dtml-print-method the line

meta http-equiv="Content-Type" content="text/html;charset=utf-8"

was missing, which is part of the html-source when not calling the print-method. This is also the case on this installation on zwiki.org, but for some reason doesn't have any negative effect. Maybe it would be a good idea to add this line to your print-method, for it might prevent future users from running into some trouble? --Benedikt

print and special characters (German Umlaute) --simon, Mon, 05 Apr 2004 09:12:44 -0700 reply
Aha, because I recently changed my apache configuration to send Content-type: utf-8 header by default. It seems the web server is really in charge of this, the html header is only a fallback.

Page Template --Curtis Yanko, Fri, 07 May 2004 07:23:36 -0700 reply
I'm trying to figure out how to embed this in a PT so I can use it in Plone. I tried to modify wikipage_view into wikipage_print. I borrowed the idiom used to pull in the useroptions.dtml and put that where wikipage_view would render the page. It ended up re-rendering the whole plone page so I am close. Where would I hook it in to get the just the wiki contents?

Page Template --DeanG, Fri, 07 May 2004 08:05:24 -0700 reply
Is there still a page function called "document"? Not sure if that is pre-formatted or not..

WikiPrinting? -- Tue, 25 May 2004 19:49:34 -0700 reply
Iam using the dtml code provided on this site for printing all the wiki's and it's associated wiki's, and i made a small change to the code < dtml-var "page.document()"> ,hence i got the document . My problem is that i want to get all the links in that link so that if i case the link leads to an wiki page then i want to print even those pages, if somebody has worked on it pls let me know

Adding print method on Plone -- Fri, 25 Feb 2005 21:57:19 -0800 reply
Running ZWiki-0-38 on Plone-2.05. Here is how I added the print method.

  1. go to your_site/your_wiki_folder/manage to get to the ZMI
  2. add DTML Method from drop down menu
  3. use the id "print", and press the Add and Edit button
  4. replace the entire default text with this, and save your changes.

You can now use this print method on your wiki pages, e.g. your_site/your_wiki_page/print

A couple notes:

Thanks to "sm" on the #zwiki irc for helping me with this.

Adding print method on Plone --DeanG, Sun, 27 Feb 2005 19:09:13 -0800 reply

* The traversal will only go down to children. Wiki pages at the same level will not be picked up.

Does it miss any pages that area also listed in the "subtopics"?

What are you hoping for in regards to printing at the "current level"?

Override PrintThisPage Icon -- Tue, 17 May 2005 11:46:46 -0700 reply
I have implemented this dtml for printing and now want to override the print this page icon on a plone site but just for ZWiki Pages. I was thinking Iwould add a condition to the portal_action for Print this Page and add a document_action to the portal_types/wiki page (which works but I have to icons, hence the need to disable the other). I'm struggling with the condition though. I tried pulling a TAL statement from a portlet (though I'm not sure it is working there either now that I look) that looks like this:

python:here.meta_type==ZWiki Page

I think I need to convert that into a string: condition or adapt it. I was hoping someone with better fu would help out ;-)

Override PrintThisPage Icon -- Fri, 27 May 2005 07:49:45 -0700 reply
I was able to get help from the Plone Users list. Here is what I was able to do. I added a Condition to the portal_actions Print this Page item:

python:object.getPortalTypeName() not in (Wiki Page,)

Then define a new document_actions to the Wiki Page type with the following:

Name: Print this page id: print action: string:$object_url/print condition: permission: View category: document_actions

The last thing I did was move the Print this page item in portal_actions to the end of the list so it would be in the same place (relative to the other document_actions) on Wiki Pages. Hope this helps other Plone users with integrating this great feature.

select subtopics to be printed --Riccardo Murri, Fri, 17 Nov 2006 10:42:41 -0800 reply
Is it possible to 1) tag some pages (subtopics of a common parent) and 2) alter the /print DTML method suggested here so to print only the tagged pages?

Could one, for instance, give set a boolean property ``print_me`` (via ZMI) on the pages to be printed and have some dtml-if test if the ``print_me`` property is on?

I'm quite ignorant of DTML and Zope programming so I don't even know if this is feasible.

select subtopics to be printed --Riccardo Murri, Fri, 17 Nov 2006 12:28:03 -0800 reply
Done: setting a boolean property on pages and testing for it with dtml-try+dtml-if did the job nicely.