Is it possible to use a link for PrintDoc instead of the image? Is it possible to call the snippet in the body of the document?
If so, how?
Thanks!
hello,
I litle problem,
I want to print the page when the popup loads.
so I did’t the following:
Open printpage witch fsck editor
click on source and add these rules:
<body onLoad="window.print();">
<font face="Arial"><font face="Arial">[[PrintDoc? &print_doc=`124` &tpl=`Print`]]</font></font>
save the document.
This works fine, but when i edit the page again witch fsck editor the first rule (<body onLoad="window.print();">) has been deleted.
How does i solved this problem?
First of all i want to thank to tihs snippet.
I ve done all the introductions. the snippet works in firefox 3 but in ie7 not.
When i created a folder and a doc under it, ie7 puts the print-doc.html under the folder and modx 404 page comes to screen.
can you help me?
[b]SOLVED:[/b] I ve put [(site_url)]/ code before [~$print_doc~]&p_ ...... in PrintDoc snippet.
so the new line is
$jslink = "javascript:void window.open(’[(site_url)]/[~$print_doc~]&p_docid=$modx->documentIdentifier’, ’win2’, ’status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=500,height=500,directories=no,location=no’);";
I note herein that more that a few found themselves only able to ’print’ the first page. In my case I was puzzled as to why this snippet worked in manager mode but not as a user, then realized that the mode treated page status differently.
[Solution] Ensure the print page is set to container & published whilst excluded from menu.
In passing, it should be noted that the print page is also a snippet so should be set not to cache to ensure the current page is loaded.
Regards
PS To OP a very neat snippet thanks.
PPS The javascript output includes an index.php whereas on the originator’s site it does not.
e.g. javascript: window.open(’index.php?id=43&p_docid=3’,’win2’, status=no, toolbar=no, scrollbars=yes, titlebar=no, menubar=no, resizable=yes, width=500, height=500, directories=no, location=no’);
I’m going to guess that you’re putting a tag for the snippet in the page content. Each time the page is rendered in the content, it executes the snippet again recursively. Could that be it?
I would like to utilize this on a site that I am working on. I however find the instructions / implementation of this extremely confusing. The directions are not very clear in my opinion. I’ve made an attempt to get this up and running on my site and it’s not quite there yet.
Does anyone have a demo of this in action where I can see how it behaves?
Quote from: thomasgrant at Sep 11, 2009, 09:28 AM
I would like to utilize this on a site that I am working on. I however find the instructions / implementation of this extremely confusing. The directions are not very clear in my opinion. I’ve made an attempt to get this up and running on my site and it’s not quite there yet.
Does anyone have a demo of this in action where I can see how it behaves?
I think most of us use CSS and a JavaScript button to print pages. Here’s an example where the button prints a coupon from an image on the page and nothing else:
CSS link:
<link rel="stylesheet" href="print.css" type="text/css" media="print" />
print.css:
body {visibility:hidden;}
.print {visibility:visible;}
#header img {
display:none;
}
body #FOOTER {
display:none;
}
body p {
display:block;
margin-left:60px;
}
body form {
display:none;
}
body hr {
display:none;
}
body img {
margin-left:100px;
}
.coupon {
margin-left:10px;
margin-top:30px;
}
.coupon form {
margin-left:250px;
margin-top:30px;
margin-bottom:30px;
}
#footer {
display:none;
}
#footer img {
display:none;
}
Button:
<div class="dontprint">
<form><input type="button" value=" Print this coupon "
onclick="window.print();return false;" /></form>
</div>
</div>