1 amoun Jan 03, 2015 03:01
3 fredsy 05 Jan 2015 05:26
Isn't this a lot of work that can be easier done by just creating the css file specifically for print and adding one line to the header, such as:
<link rel="stylesheet" href="print.css" type="text/css" media="print" />
It's one extra file and one line of code in the skin, instead of a whole new skin. No need to append the tempskin to the print button, and in fact, no need for a print button at all.
Maybe I'm missing something here...
4 amoun 05 Jan 2015 18:17
Hi fredsy.
Thanks for your input and concern.
Your idea does work, and I did do that originally but there is no Print Preview of what the page will look like when the alternate stylesheet is invoked, or to put it another way, the Print Preview option only shows the viewed page not what it will look like using an alternate stylesheet
This way the page is styled before the Print Preview is invoked.
To make this clear I'll put a note to that effect on the original post
Thanks again
5 fredsy 06 Jan 2015 10:06
Hmmm... not sure I quite understand. If you use a browser there will be a print preview option in the toolbars. Not sure how it works on tablet/mobile, but I know for desktop at least if you use print preview it will show you the page using the print.css styles and not the default. I wonder how many people use print buttons vs using the toolbar options on their browser?
6 amoun 06 Jan 2015 11:54
Hi again.
I have been using Ubuntu 14.04 and Fx 34
I think you are right in what you say in many cases the problem seems to arise with some css attributes in some instances. The main one I had, which I noted others had, was a failure to implement the css.float attribute, It is important for me as I have made a styling plugin that uses the float attribute and of course on posts where that was used the layout is not as I want.
So even though html_header file has the include_headlines() function it didn't bring in all the styling from my_plugin and when I added the styling directly to the print.css in the usual_skin it still didn't work.
As I noticed other's had this problem I thought of having a skin to avoid the plugin issue.
But as it works otherwise, and with your responses, I'll go over the details again and see if I can get it to work without the extra skin and code. It may be a poor implementation of my_plugin
However there is the issue that with the addition I have, a user can either do a Print/(Print Preview) of either the whole website or use the Print button and the option which is styled by the [print.css]; whereas in the simplified version there is no choice, there is only the view styled by the [print.css]
Update 9th Jan
There's also the benefit, where someone wants to save the page to html, that by restyling the page in the browser, the saved file can just exhibit the post, otherwise any save will take in the full site page as the [print.css] will not have been invoked.
Have added an updated intro to the main post
Thanks again :)
Page Bug
I had defined skin_init($disp='single') in my [/skins/print/index.main.php] which of course didn't work when I put the print link code in a 'page'
Now
1. In [index.main.php] I have changed skin_init($disp='single') to skin_init($disp) and
2. passed the $disp via the link url i.e.
echo'<a href="http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].'?tempskin=print&disp='.$disp.'" target="_blank">Print</a>';
Code now also working in [/skins/my_usual_skin/page.main.php]