Hi,
I am trying to print on paper (using Firefox or Chrome) a Template layout of a CPT, and new lines are introduced after all cells.
So layout cell alignment is lost.
Any idea why?
Thank you ,
Kostas
I tried this, and I must ask what you plan to do with a printed Layout.
It seems (sorry, I have not such a valuable knowledge on this specific topic) that the Print feature of Browsers just plots every HTML present on the screen, into a somewhat readable structure.
But, as far I see, even hidden stuff, like for example, all the possible Cells, are printed. Even if no such cell is actually inserted to the Layout, but lives yet only in the "Add Cell" menu process.
I see that after each cell the print shows a line break. But I do not think we can do something at all here, since this is completely handled by the browser, and unless I miss something, it will produce a very confusing print either way, with or without line breaks.
Can you elaborate what you try to achieve? Maybe I can consult with my colleagues to find a more suitable approach!
Hi Beda,
Thank you for responding.
What I am trying to do is, as users are creating new posts, some might need to print them, for hard copy archiving purposes, etc. I was expecting to print what I see on the browser, but this is not the case because of the inserted line breaks after each cell.
So maybe the line breaks are present in the Template layout and the browser just renders them?
Thank you,
Kostas
Hi again Beda,
I forgot to emphasize, the problem is on the front-end. My users do not have access to the back-end. So, there is no problem with hidden stuff, as you described. We are only talking about the front-end here.
Cheers,
Kostas
I confirm this, but it is not related to Toolset.
It is as well happening when you remove all Toolset Plugins and put this into any WordPress native page or post text editor:
<div class="row">
<div class="col-md-4">
here
</div>
<div class="col-md-8">
there
</div>
</div>
If you print the page you get a break at each end of sub div.
I would suggest to research in the Bootstrap Forums.
Hi Beda,
Thank you for the tips!
I believe I have found the cause of the problem: Bootstrap.css is linked in the Template layout with the attribute media="screen", so it is ignored by printers:
<link rel="stylesheet" id="toolset_bootstrap_styles-css" href="<em><u>hidden link</u></em>" type="text/css" media="screen">
If it is linked with media="all" problem is solved.
Can you please confirm?
Cheers,
Kostas
It does not solve the issue for me.
We could pass the last parameter "media" in our register_style() function, but as I tested it - it makes no difference.
This is not an issue of Toolset - it is happening due to Bootstrap as it seems to me.
Yes, but Bootstrap is linked as I described in the Template layout ie Toolset, correct?
The way I tested was to include in Toolset > Layouts CSS and JS, this:
jQuery(document).ready(function(){
jQuery('#toolset_bootstrap_styles-css').attr('media', 'all');
})
Is this not working for you?
I can edit the core code to make the media attribute "all".
And no, this does not change it, as well not the custom code you shared.
It will still print the Bootstrap as new lines.
If you disable Toolset and use another way to call bootstrap, the same happens.
https://stackoverflow.com/questions/19948474/bootstrap-3-print-layout-and-breaks-after-each-grid-column
https://stackoverflow.com/questions/18974662/printing-twitter-bootstrap-correctly
I don't know why this happens, but I know this cannot be solved within Toolset.
This is weird, maybe we are not looking at the same place...
You are looking at the front-end, correct?
Yes.
I look at the front end, and then I print the page (In the Browser Menu, the feature "print")
This gives me a preview, and the preview always looks the same (stacked).
This, to me, as elaborated is a confirmed issue of Bootstrap.
We cannot solve this in Toolset Layouts.
Anyway, my suggested workaround works for me, so I am now closing this ticket.
Hi Kostas,
I’m Mohammed: the Toolset support team leader.
I just got your feedback about this ticket and I'm posting here because I see that you are not happy with how Beda handled your ticket.
As you are a valuable client of Toolset, me and all the team are very careful to help you and offer the best support service as possible as we can.
After checking all the ticket replies I found that the best thing to be done here is to offer a workaround to you which you already did yourself which actually helps us and other clients who will have the same problem. so, Thank you for that.
The reason why Beda didn't agree with you that the issue is from Toolset side is that we don't have control over Bootstrap CSS or JS.
We use Bootstap as is and we don't change anything in Bootstrap in order to be compatible with it all the time. And, if we made a change in Bootstap, it will be a complete mess.
Of course, if you have any suggeestions to make this better, we will be happy to reviece it and also we will take it seriously.
So, thank you for providing this workaround and I hope you get satisfied the next time you post a ticket in the Toolset support forum.
Thanks,
Mohammed
Hello Mohammed,
Thank you for responding.
My suggestion was not to change Bootstrap.
My suggestion was to change the way you link to Bootstrap from within Toolset. My workaround corrects just that. Simple as that. I am surprised it is not understood.
I see this ticket is reopened. Please close this ticket.
Cheers,
Kostas
Thank you, Kostas
As I elaborated, I tried this, I edit the Code files, to load it exactly the suggested way.
I needed to add that attribute as we do not pass it natively in the Code.
Still, it made no change the preview as I elaborated.
This issue happens also when you take any Theme that enqueues Bootstrap and print it.
I tested this. Please let me know if I miss some detail.