Recent Topics

1 Mar 16, 2009 17:33    

My b2evolution Version: 1.10.x

Does anyone have any advice or CSS to share about how to give a reader the option to view a post for printing? That is, i'd like to have a link in my posts that say "Click here for print format" and the post is rendered in a simple formatting that would not have the sidebars, headers, etc., that normally display with the post.

Thanks!

2 Mar 17, 2009 00:03

If you're really using v1.10 then this won't apply exactly, but I don't have a copy of that version laying about, so I'll pretend you're running v2.4.6 and go from there. Conceptually it's all the same though ... just different file names. Find and edit /skins/_html_header.inc.php looking for

<link rel="stylesheet" href="style.css" type="text/css" media="screen" />

and making it be:

<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
<link rel="stylesheet" href="print.css" type="text/css" media="print" />

Now you need to add to your /skins/yourskin/ folder a print.css file, which will really have to depend on your exact skin's divs and if they're ids or classes. But basically here's a shell of one:

/* Browsers don't always get this right, so just enough to make the body print okay */
body {
font-family: serif; font-size: 11pt;
}

#wrapper-header {
margin: 0px;
padding: 0px;
width: auto;
font-weight: bold;
border: none;
}

.bTitle {
margin-top: 12px;
margin-bottom: 6px;
}

img {
border: none;
}

.bPosts, .bPost {
float: none;
margin: 0px;
padding: 0px;
width: auto
}

.bPost {
margin-bottom: 22px;
}

#menu-top, #wrapper-menu-page, #wrapper-footer {
display: none;
}

.bPost is for if the div is a class, #menu-top is for if your div is an id. Basically though you can't control the printer so trying should be very limited at best. I also hide the sidebar, or at least used to when I used to upgrade skins and include a print.css sheet. The last block where it has three things then "display:none" is what hides a section from the browser.

Good luck, and welcome to the forums!

Oh and if v1.10 is really your version you should upgrade. the 1.* generation is pretty much obsolete. v2.4.6 is way cool and very very stable.

3 Mar 18, 2009 01:15

Thanks! I will take your advice and upgrade to the latest.


Form is loading...