[TYPO3-english] printlink for multilanguage

Christopher Torgalson bedlamhotel at gmail.com
Wed Oct 15 17:14:58 CEST 2008


Hi,

On 15-Oct-08, at 3:25 AM, Rupali Gupta wrote:

> oh ya,i didn't think about that, done !
> thanks !
>
> suggestions for pt 2) are also welcome !
> :)


You have not completely adapted the code to your specific  
circumstances. The sample adds and removes a GET parameter called  
'print,' but I imagine you've set up 'printable' page rendering with a  
different page type. The sample shows only how to add and remove a  
parameter from the current url--you have to decide a) which parameter  
gets added/removed, and b) what happens on the basis of that parameter.

A couple of other things:

a) Your code tries to open a new window in two different ways at the  
same time (i.e. 'target="_blank"' and via JSwindow), why?
b) IMO creating a whole new page rendering object in TYPO3 is  
inefficient. I'd personally do the following instead:

1. Set up a print stylesheet [1] so that the page prints in a suitable  
way whether the user first clicks a 'print' link or not (try a print  
preview on the pages at typo3apprentice.com--the difference is only a  
matter of styling the content differently)

2. Set up a url switch that adds/removes something like &print=1 to  
the url

3. Using conditions, render the 'printable' page exactly as the  
regular page is rendered but with *only* the print stylesheet called  
and the 'media' attribute set to 'all' or 'screen'

In other words, the difference between the 'regular' and 'printable'  
pages is that in the regular page, you have a set of calls to  
stylesheets like this:

	<link rel="stylesheet" type="text/css" href="path/to/screen.css"  
media="screen" />
	<link rel="stylesheet" type="text/css" href="path/to/print.css"  
media="print" />

...but in the printable page you have only this stylesheet reference:

	<link rel="stylesheet" type="text/css" href="path/to/print.css"  
media="screen" />


[1] http://www.google.com/search?q=print+stylesheet


--
Christopher Torgalson
http://www.typo3apprentice.com/







More information about the TYPO3-english mailing list