Sina
(Sina)
February 21, 2025, 1:19pm
1
Hi @Max .
i have a CTA Button to print the css results container.
The entire page is still displayed in the print preview.
Maybe that would be an approach, but somehow it doesn’t work. Do you think the devs could take a look at it?
<button onclick="window.print()">Print Results</button>
@media print {
body * {
visibility: hidden !important; /* All hidden */
}
.results__Container-sc, .results__Container-sc * {
display: block !important; /* show only .result.container */
visibility: visible !important;
}
.results__Container-sc {
position: absolute;
top: 0;
left: 0;
width: 100%;
}
}
2 Likes
Sina
(Sina)
February 21, 2025, 2:31pm
2
I’m on the right track, but not perfect yet.
@media print {
[class*="header__Container-sc"],
[class*="form__Container-sc"] {
display: none !important;
}
[class*="results__Container-sc"] {
display: visible !important;
}
[class*="results__Container-sc"] {
margin-top: -230px !important;
margin-left: -130px !important;
}
}
2 Likes
Max
February 21, 2025, 7:32pm
3
Wow, interesting workaround! Many thanks for sharing your wisdom, @Sina
You’d like to display in the print preview the section with the results only, right?
1 Like
Max
February 24, 2025, 6:57pm
5
Thanks! I’ve double-checked the widget, and it seems that you’ve already adjusted the code to display only results.
Do I get it right, that now everything is working as you wish?
1 Like
Sina
(Sina)
February 25, 2025, 7:01am
6
Hi @Max ,
If you think my adjustment is good, then I’ll leave it as it is. But I haven’t figured out the problem (the border) yet.
2 Likes
Max
February 25, 2025, 3:43pm
7
Hi @Sina
When I’ve checked the widget, the full title was inside this frame (and it looks this way now), this is why I thought it was done intentionally:
However, I’ll discuss with the devs if it’s possible to remove the border
2 Likes
Sina
(Sina)
February 25, 2025, 6:49pm
8
Hi @Max , thank you for your feedback.
this is the printscreen in Firefox
and this is Chrome
The frame is still there on the printout with Firefox.
The small frame wouldn’t be the problem, it can stay. Rather, it is the frame of the larger frame.
I have found a solution
[class*="WidgetBackground__Container-sc"] {
border: none !important;
box-shadow: none !important;
}
We now have the whole discussion in the wish list, which is actually about PDF printing.
You can still do it as a workaround.
Here is the complete code for printing the result section if anyone wants it.
@media print {
[class*="header__Container-sc"],
[class*="form__Container-sc"],
button {
display: none !important;
}
[class*="WidgetBackground__Container-sc"] {
border: none !important;
box-shadow: none !important;
}
[class*="WidgetBackground__Content-sc"] {
padding: 0px !important;
margin-top: 0px !important;
margin-left: 0px !important;
}
[class*="results__Container-sc"] {
display: visible !important;
gap: 10px
}
}
1 Like
Max
February 26, 2025, 3:40pm
10
Wow, I’ve checked your code, and it works great in your widget, but, unfortunately, it won’t be a universal solution for all users, since the code works only with the specific settings and fields added.
But anyway, thank you so much for sharing your cool workaround with us - that’s much appreciated
1 Like