print css and adding a logo?

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
cyrano
Posts: 1598
Joined: Sat 31. Jan 2004, 18:33
Location: Stuttgart
Contact:

print css and adding a logo?

Post 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.
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
Pappnase

Re: print css and adding a logo?

Post 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!?
cyrano
Posts: 1598
Joined: Sat 31. Jan 2004, 18:33
Location: Stuttgart
Contact:

Post 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?
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
Pappnase

Post by Pappnase »

hello

maybe as backgroundimage!? in the bodytag!?
cyrano
Posts: 1598
Joined: Sat 31. Jan 2004, 18:33
Location: Stuttgart
Contact:

Post by cyrano »

this would be an idea, with layers...
and text?
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
tyr
Posts: 31
Joined: Tue 9. Dec 2003, 04:36
Location: Pennsylvania, USA

Post by tyr »

Or maybe set the style to hide the logo for all media except for printing.
Jérôme
Posts: 481
Joined: Tue 16. Mar 2004, 10:33
Location: Cologne, Germany
Contact:

Post 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
cyrano
Posts: 1598
Joined: Sat 31. Jan 2004, 18:33
Location: Stuttgart
Contact:

Post 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.
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
Jérôme
Posts: 481
Joined: Tue 16. Mar 2004, 10:33
Location: Cologne, Germany
Contact:

Post 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>
cyrano
Posts: 1598
Joined: Sat 31. Jan 2004, 18:33
Location: Stuttgart
Contact:

Post 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 :)
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
Jérôme
Posts: 481
Joined: Tue 16. Mar 2004, 10:33
Location: Cologne, Germany
Contact:

Post 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
yuluma
Posts: 53
Joined: Wed 29. Sep 2004, 04:00
Location: Alkmaar - Netherlands - Europe
Contact:

Post 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........
Yuluma Nunbanna - workaholic ad dies vitae
cyrano
Posts: 1598
Joined: Sat 31. Jan 2004, 18:33
Location: Stuttgart
Contact:

Post by cyrano »

hi,

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
yuluma
Posts: 53
Joined: Wed 29. Sep 2004, 04:00
Location: Alkmaar - Netherlands - Europe
Contact:

arg... stupid of me

Post 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 ?
Yuluma Nunbanna - workaholic ad dies vitae
cyrano
Posts: 1598
Joined: Sat 31. Jan 2004, 18:33
Location: Stuttgart
Contact:

Post 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
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
Post Reply