print css and adding a logo?
print css and adding a logo?
hi,
how can i change the looking of a page when i have clicked "print"?
I would like to add a logo in the head and and small footer line.
thank you for advice and hints.
how can i change the looking of a page when i have clicked "print"?
I would like to add a logo in the head and and small footer line.
thank you for advice and hints.
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
Re: print css and adding a logo?
hello cyranocyrano wrote:hi,
how can i change the looking of a page when i have clicked "print"?
I would like to add a logo in the head and and small footer line.
thank you for advice and hints.
maybe by editing the print.css!?
hmm, i don't know, but i don't think so, because i cannot add a link into css or?
so to load a image and a text into this print-layout-css-page....
hmm?
so to load a image and a text into this print-layout-css-page....
hmm?
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
this would be an idea, with layers...
and text?
and text?
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
Look into include/inc_front/content.func.inc.php.
Search for the string "//if print layout should be showed" (around line 258).
You will find something like this:
This means that only what is in the block "maintext" will be shown on the printout. You could try to change it to
I haven't tested it, but this should be it. (Don't forget to fill the variables $prepend and $postpend with the output you want to have there).
PS: There could be an additional area in the admin area of phpwcms to be able to enter this information in the backend frontend of phpwcms.
Hope that helped and many greetings
- Jérôme
Search for the string "//if print layout should be showed" (around line 258).
You will find something like this:
Code: Select all
//if print layout should be showed
$content["all"] = $block["maintext"]; //$content["main"]
$block["css"] = "print_layout.css"; //sets css to standard printing layout
Code: Select all
//if print layout should be showed
$prepend = "";
$postpend = "";
$content["all"] = $prepend.$block["maintext"].$postpend; //$content["main"]
$block["css"] = "print_layout.css"; //sets css to standard printing layout
PS: There could be an additional area in the admin area of phpwcms to be able to enter this information in the backend frontend of phpwcms.
Hope that helped and many greetings
- Jérôme
hach was wäre das web ohne Jérôme
)
Merci bien, avec texte se marche bien, mais ou je fais ca avec une image?
And how to have influence with the positioning?
can I set a table within the " "?
Merci bien.

Merci bien, avec texte se marche bien, mais ou je fais ca avec une image?
And how to have influence with the positioning?
can I set a table within the " "?
Merci bien.
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
You can set any HTML you want between the "", that includes images, CSS information and other things.
Example:
Example:
Code: Select all
<div align="center"><img src="/path/to/logo.png" alt="Logo" /></div>
hmm, no i get errors
and made - sure :- ) - something wrong:
Update: I remembered some lines of code as we made the cd-rom, and uses now within the outer "" the '', then it works fine.
Thanks Jérôme 
Code: Select all
Parse error: parse error, unexpected T_STRING in /www/htdocs/xcxc/include/inc_front/content.func.inc.php on line 259
Code: Select all
//if print layout should be showed
$prepend = "<div align="left"><img src="/picture/logo.jpg" alt="Logo" /></div>";
$postpend = "copyright 2000-2004 hansi müller";
$content["all"] = $prepend.$block["maintext"].$postpend; //$content["main"]
$block["css"] = "print_layout.css"; //sets css to standard printing layout
Update: I remembered some lines of code as we made the cd-rom, and uses now within the outer "" the '', then it works fine.
Code: Select all
//if print layout should be showed
$prepend = "<div align='left'><img src='/picture/logo.jpg' alt='Logo' /></div>";
$postpend = "copyright 2000-2004 hansi müller";
$content["all"] = $prepend.$block["maintext"].$postpend; //$content["main"]
$block["css"] = "print_layout.css"; //sets css to standard printing layout

Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
You can also escape the double quotation marks:
This produces nicer source-code.
On the other hand, you can also wrap everything in single quotation marks:
But then, you can't use php variables between the single quotation marks. You would then have to interrupt the string, insert your variable and continue the string.
But the performance-question is another issue
.
- Jérôme
Code: Select all
$prepend = "<div align=\"left\"><img src=\"/picture/logo.jpg\" alt=\"Logo\" /></div>";
On the other hand, you can also wrap everything in single quotation marks:
Code: Select all
$prepend = '<div align="left"><img src="/picture/logo.jpg" alt="Logo" /></div>';
But the performance-question is another issue

- Jérôme
Where do i fill in the variables, not in the main text i think because i don't want the logo to apear on the website, only on the printpage. Can't figger it out........Jérôme wrote: I haven't tested it, but this should be it. (Don't forget to fill the variables $prepend and $postpend with the output you want to have there).
PS: There could be an additional area in the admin area of phpwcms to be able to enter this information in the backend frontend of phpwcms.
Hope that helped and many greetings
- Jérôme
Yuluma Nunbanna - workaholic ad dies vitae
hi,
read above the text from jérôme....
include/inc_front/content.func.inc.php.
read above the text from jérôme....
include/inc_front/content.func.inc.php.
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
arg... stupid of me
offcourse, but then i have some error. I did as acording. put my code in the mentioned file like this:
however the logo doesn't show up, neether do i see the code in the sourcecode of the file !
any ideas of what i missing ?
Code: Select all
//if print layout should be showed
$prepend = "<div align=\"center\"><table width=\"550\"><tr><td> <img src=\"/picture/logo.jpg\" alt=\"N & S Groep\" /></tr></td></table> </div>";
$postpend = " ";
$content["all"] = $block["maintext"]; //$content["main"]
$block["css"] = "print_layout.css"; //sets css to standard printing layout
any ideas of what i missing ?
Yuluma Nunbanna - workaholic ad dies vitae
yes you missed the postpend and prepend:
compare it with above written by jérôme again please:
compare it with above written by jérôme again please:
Code: Select all
This means that only what is in the block "maintext" will be shown on the printout. You could try to change it to
//if print layout should be showed
$prepend = "";
$postpend = "";
[color=red] $content["all"] = $prepend.$block["maintext"].$postpend; //$content["main"][/color]
$block["css"] = "print_layout.css"; //sets css to standard printing layout
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3