[TYPO3-german] tx_

Marian Aldenhövel marian at mba-software.de
Tue May 8 15:10:02 CEST 2007


Hallo,

Ich habe Probleme damit eine Druckansicht zu erzeugen. Ich verwende
tx_make_printlink, aber ohne Sinn und Verstand, da ich nicht verstehe
was es eigentlich tut :-).

Meine Site verwendet außerdem den Template Selector und drei
Hauptvorlagen kombiniert mit drei Subtemplates, die den Content-Bereich
gliedern. Da mir nicht eingefallen ist, wie ich das auf die neu
anzulegende PAGE für die Druckansicht zu übertragen hätte, habe ich
mir überlegt dieselbe Vorlage zu verwenden und bei der Druckansicht
den "störenden Kram" (Navigation, Footer, etc.) per CSS auszublenden.

Also habe ich (Ausschnitte):

 > # Default PAGE object:
 > page = PAGE
 > page {
 >   typeNum = 0
 >   config  {
 >     doctype = xhtml_trans
 >     index_enable = 1
 >     index_externals = 1
 >  }
 >
 >  includeCSS {
 >    file1 = fileadmin/templates/main/acbh.css
 >    file2 = fileadmin/templates/main/acbh-content.css
 >    file3 = fileadmin/templates/main/acbh-tt-news.css
 >    file4 = fileadmin/templates/main/acbh-dropdown-sitemap.css	
 >    file5 = fileadmin/templates/main/acbh-print.css
 >    file5.media = print
 >  }
 >
 >   # Copying the content from TEMPLATE for <body>-section:
 >   10 < temp.mainTemplate
 >
 >   # Copying the content from TEMPLATE for <head>-section:
 >   headerData.10  < temp.headTemplate
 > }

Und dasselbe für die Druckansicht, plus leicht modifiziertes CSS. Es
unterscheiden sich die typeNum und CSS file5 wird nicht mit "print"
spezifiziert, weil es ja eine DruckANSICHT ist, also auch auf dem
Bildschirm wie für den Drucker formatiert wird. Äh. Ja.

 > # Printable Page
 > print_page = PAGE
 > print_page {
 >   typeNum = 98
 >   config {
 >     doctype = xhtml_trans
 >     index_enable = 1
 >     index_externals = 1
 >   }
 >
 >   includeCSS {
 >     file1 = fileadmin/templates/main/acbh.css
 >     file2 = fileadmin/templates/main/acbh-content.css
 >     file3 = fileadmin/templates/main/acbh-tt-news.css
 >     file4 = fileadmin/templates/main/acbh-dropdown-sitemap.css	
 >     file5 = fileadmin/templates/main/acbh-print.css
 >   }
 >
 >   # Copying the content from TEMPLATE for <body>-section:
 >   10 < temp.mainTemplate
 >
 >   # Copying the content from TEMPLATE for <head>-section:
 >   headerData.10  < temp.headTemplate
 > }

Nun versuche ich einen Link zu basteln, der die Druckansicht in einem neuen
Fenster öffnet:

 > # make printable page
 > temp.PRINT = TEXT
 > temp.PRINT {
 > 	value = Druckansicht
 >
 > 	postUserFunc = tx_make_printlink
 >       postUserFunc {
 >         	windowname = Druckansicht
 >         	include_post_vars = 1
 > 		popup = 1
 > 		title = Druckansicht
 >    		windowparams = (menubar=1,toolbar=1,height=550,width=780)
 >    	}
 > }

Diese Fassung funktioniert fast. Sie produziert einen Link wie:

 > <a href="#"
 >   onfocus="blurLink(this);"
 >  onclick="window.open('fuer-neulinge-interessierte/flugzeugpark/print',
 >       'Druckansicht',
 >       '(menubar=1,toolbar=1,height=550,width=780)'
 >  );">Druckansicht</a>					

Das öffnet zwar das neue Fenster, aber im Hauptfenster wird zur Startseite
gewechselt, was unerwünscht ist.

Ersetze ich "popup = 1" durch "target = _blank", so öffnet mein Firefox die
Seite in einem neuen Tab. Auch nicht ganz das, was ich will.

Ciao, MM
-- 
Marian Aldenhövel, Rosenhain 23, 53123 Bonn
http://www.marian-aldenhoevel.de
"Parmesan und Partisan, wo sind sie geblieben?
  Partisan und Parmesan, beide sind zerrieben"


More information about the TYPO3-german mailing list