Page 1 of 2
print css and adding a logo?
Posted: Sun 4. Jul 2004, 12:26
by cyrano
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.
Re: print css and adding a logo?
Posted: Sun 4. Jul 2004, 12:38
by Pappnase
cyrano 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.
hello cyrano
maybe by editing the print.css!?
Posted: Sun 4. Jul 2004, 13:22
by cyrano
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?
Posted: Sun 4. Jul 2004, 13:23
by Pappnase
hello
maybe as backgroundimage!? in the bodytag!?
Posted: Sun 4. Jul 2004, 13:35
by cyrano
this would be an idea, with layers...
and text?
Posted: Sun 4. Jul 2004, 22:51
by tyr
Or maybe set the style to hide the logo for all media except for printing.
Posted: Mon 5. Jul 2004, 13:15
by Jérôme
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:
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
This means that only what is in the block "maintext" will be shown on the printout. You could try to change it to
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
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
Posted: Mon 5. Jul 2004, 15:12
by cyrano
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.
Posted: Mon 5. Jul 2004, 19:27
by Jérôme
You can set any HTML you want between the "", that includes images, CSS information and other things.
Example:
Code: Select all
<div align="center"><img src="/path/to/logo.png" alt="Logo" /></div>
Posted: Mon 5. Jul 2004, 20:59
by cyrano
hmm, no i get errors
Code: Select all
Parse error: parse error, unexpected T_STRING in /www/htdocs/xcxc/include/inc_front/content.func.inc.php on line 259
and made - sure :- ) - something wrong:
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
Thanks Jérôme

Posted: Mon 5. Jul 2004, 22:15
by Jérôme
You can also escape the double quotation marks:
Code: Select all
$prepend = "<div align=\"left\"><img src=\"/picture/logo.jpg\" alt=\"Logo\" /></div>";
This produces nicer source-code.
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 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
Posted: Sun 10. Oct 2004, 19:52
by yuluma
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
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........
Posted: Sun 10. Oct 2004, 19:56
by cyrano
hi,
read above the text from jérôme....
include/inc_front/content.func.inc.php.
arg... stupid of me
Posted: Sun 10. Oct 2004, 20:27
by yuluma
offcourse, but then i have some error. I did as acording. put my code in the mentioned file like this:
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
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 ?
Posted: Sun 10. Oct 2004, 20:33
by cyrano
yes you missed the postpend and prepend:
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