View previous topic :: View next topic |
Author |
Message |
abacquer
Joined: 22 Mar 2004 Posts: 193
|
Posted: Tue May 25, 2004 10:07 am Post subject: "Printer Friendly" |
|
|
A couple people have written to me wanting to print my blog articles to complain about the 3-column layout. Many sites out on the net which offer written content also include a "printer friendly" link which redsiplays the same content without sidebars.
Is there any automated way to do that on BlogHarbor?
BTW: is it just me or is BlogHarbor *really* slow right now? This morning my blog is taking forever to load. _________________ -- Abacquer, A.K.A. Chuck Seggelin |
|
Back to top |
|
|
Kyle93815
Joined: 26 Apr 2004 Posts: 39 Location: Austin, TX
|
|
Back to top |
|
|
john Site Admin
Joined: 16 Mar 2004 Posts: 3434
|
Posted: Tue May 25, 2004 11:37 pm Post subject: Re: "Printer Friendly" |
|
|
From the same source Kyle referred to is also this post:
http://www.alistapart.com/articles/goingtoprint/
which explains how to create an alternate stylesheet you could include in your blog which would automatically reformat your blog for print. You could create a print stylesheet that eliminates #leftcol and #rightcol ...
abacquer wrote: | BTW: is it just me or is BlogHarbor *really* slow right now? This morning my blog is taking forever to load. |
We didn't see anything unusual this morning, next time shoot us a support email at the exact time you experience any problems and we'll investigate. |
|
Back to top |
|
|
abacquer
Joined: 22 Mar 2004 Posts: 193
|
Posted: Thu May 27, 2004 2:37 pm Post subject: Re: "Printer Friendly" |
|
|
Thanks for the tips guys... I'll look into that.
john wrote: | abacquer wrote: | BTW: is it just me or is BlogHarbor *really* slow right now? This morning my blog is taking forever to load. |
We didn't see anything unusual this morning, next time shoot us a support email at the exact time you experience any problems and we'll investigate. |
That wasn't you guys, that was FURL. FURL was down and so my page wouldn't load. _________________ -- Abacquer, A.K.A. Chuck Seggelin |
|
Back to top |
|
|
abacquer
Joined: 22 Mar 2004 Posts: 193
|
Posted: Thu May 27, 2004 3:02 pm Post subject: Re: "Printer Friendly" |
|
|
john wrote: | which explains how to create an alternate stylesheet you could include in your blog which would automatically reformat your blog for print. You could create a print stylesheet that eliminates #leftcol and #rightcol ... |
Okay, I read the articles and I can figure out how to make a stylesheet for printing, but how to I create a link or a button that causes that stylesheet to be loaded for that page? Is there a way in javascript to replace the current stylesheet with a different one? _________________ -- Abacquer, A.K.A. Chuck Seggelin |
|
Back to top |
|
|
abacquer
Joined: 22 Mar 2004 Posts: 193
|
Posted: Thu May 27, 2004 4:01 pm Post subject: Got it... |
|
|
Okay I think I know how to do it now... if I add this to my <HEAD> tag:
Code: | <LINK HREF="printer_friendly.css" REL="alternate stylesheet" TYPE="text/css" TITLE="printer_friendly">
<SCRIPT>
function setPrinterFriendly() {
var i, a, main;
for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
if(a.getAttribute("rel").indexOf("style") != -1) {
a.disabled = true;
if(a.getAttribute("title") == "printer_friendly") a.disabled = false;
}
}
}
</SCRIPT> |
Then all I need to do is provide a link or a button in a custom component that switches the style. I don't want the switch to be permanent or anything, this is just so the page can be printed. I think blogharbor lets you add custom stuff to <HEAD>... _________________ -- Abacquer, A.K.A. Chuck Seggelin |
|
Back to top |
|
|
john Site Admin
Joined: 16 Mar 2004 Posts: 3434
|
Posted: Thu May 27, 2004 9:03 pm Post subject: Re: Got it... |
|
|
abacquer wrote: | Okay I think I know how to do it now... if I add this to my <HEAD> tag: |
None of this is really necessary, that's the beauty of using CSS. In the old days before CSS, you would need to actually generate some version of your page to be printer friendly. Now, you just need to add this to the HEAD of your document:
Code: | <link rel="stylesheet" type="text/css" media="print" href="print.css" /> |
and when the page prints, it will be printed according to the print.css stylesheet... |
|
Back to top |
|
|
abacquer
Joined: 22 Mar 2004 Posts: 193
|
Posted: Fri May 28, 2004 8:05 am Post subject: |
|
|
That's great, John! Thanks!
EDIT: It's done. Looks pretty good I think. Wrote a brief blog article about what I learned in the process. Thanks to everyone who helped! _________________ -- Abacquer, A.K.A. Chuck Seggelin |
|
Back to top |
|
|
Kim Guest
|
Posted: Wed Jun 16, 2004 3:50 am Post subject: Printerfriendly |
|
|
On behalf of us who are not able (or willing) to edit stylesheets: I whish that BlogHarbor could make a component named "PrinterFriendly". |
|
Back to top |
|
|
john Site Admin
Joined: 16 Mar 2004 Posts: 3434
|
Posted: Wed Jun 16, 2004 11:09 pm Post subject: Re: Printerfriendly |
|
|
We do have tentative plans to implement "Printer Friendly" versions of the weblog pages. May not be until the end of the summer or so but it is something that is being developed... |
|
Back to top |
|
|
vtmnldy Guest
|
Posted: Thu Oct 07, 2004 12:10 pm Post subject: Printer friendly |
|
|
Ha-hmmm - summer is about over ...... |
|
Back to top |
|
|
john Site Admin
Joined: 16 Mar 2004 Posts: 3434
|
Posted: Thu Oct 07, 2004 11:21 pm Post subject: Re: Printer friendly |
|
|
vtmnldy wrote: | Ha-hmmm - summer is about over ...... |
I think when I said summer or so the or so part should cover me well into late fall.
You're correct, this feature did not make into the most recent update. In the meantime, abacquer wrote a great article on doing this yourself:
http://unbecominglevity.blogharbor.com/blog/_archives/2004/5/28/79642.html
I just implemented it on our demo site (which should help when printing the manual pages) and it took only about 5 or 10 minutes.
Here's the code I used for the printer_friendly.css file:
Code: | TABLE.columns TD.left {
display: none;
}
TABLE.columns TD.right {
display: none;
}
TABLE.blogHeader TD.blogHeaderCenter {
display: none;
}
TABLE.blogHeader TD.blogHeaderRight {
display: none;
}
display: none;
}
display: none;
}
.commentFormInline {
display: none;
}
.noncompliant {
DISPLAY: none
}
|
|
|
Back to top |
|
|
cd
Joined: 03 Jul 2004 Posts: 69
|
Posted: Tue Nov 30, 2004 9:15 am Post subject: Re: Printer friendly |
|
|
Hi John,
forgive my ignorance but i am not an html programmer so after reading the article i still need a step-by-step. can i just copy Abacquer's code? where exactly does one save a style sheet, specfically the printer_friendly.css code? where is the head tag and how do i save to it?
it would be great if you could provide a step-by-step.
thx! |
|
Back to top |
|
|
john Site Admin
Joined: 16 Mar 2004 Posts: 3434
|
Posted: Thu Dec 02, 2004 12:06 am Post subject: Re: Printer friendly |
|
|
Here's a quick summary:
1) Create a text file in Notepad and save it as printer_friendly.css. Copy this text to that file, and save it:
Code: | TABLE.columns TD.left {
display: none;
}
TABLE.columns TD.right {
display: none;
}
TABLE.blogHeader TD.blogHeaderCenter {
display: none;
}
TABLE.blogHeader TD.blogHeaderRight {
display: none;
}
#leftcol {
display: none;
}
#rightcol {
display: none;
}
.commentFormInline {
display: none;
}
.noncompliant {
DISPLAY: none
}
|
2) Now log into your blog control panel, and upload the printer_friendly.css file to the top level (Home) of your File Manager. See this page for a little help on uploading files there:
http://demo.blogharbor.com/blog/_archives/2004/8/14/123896.html
3) Go to Settings & Security > General in the control panel and look for the area labeled Additional <HEAD> Content. Add the following code:
Code: | <link rel="stylesheet" type="text/css" media="print" href="/printer_friendly.css" /> |
and click the Save Settings button at the bottom of the page.
That's it, you're done.
Last edited by john on Fri Dec 29, 2006 1:45 am; edited 6 times in total |
|
Back to top |
|
|
cd
Joined: 03 Jul 2004 Posts: 69
|
Posted: Thu Dec 02, 2004 8:17 am Post subject: supposed to see a print button? |
|
|
Hi John,
thanks for the play-by-play! am i supposed to see a print button in each article now?
i read in abacquer's article that one could now print preview w/o any side bars etc... that doesn't appear to be working for me either.
i went to blogharbor demo : Posting Articles and that is cool when one does a print preview! i guess that is what i am supposed to be seeing. not seeing that. help?
thx! |
|
Back to top |
|
|
Search all BlogHarbor support resources.
|
View previous topic :: View next topic |
|