Zum Inhalt springen

Wieder einmal: make_printlink und realurl

Erstellt am 9. August 2007 · 3 Antworten · letzte Antwort am 20. August 2007

Tags: RealURL, Links, Frage

dabjoern ·

Hallo Leute,

ich habe folgende Konfiguration:

#Druckvorschau einrichten
print = PAGE
print {
  bodyTag = <body onload="javascript:print();">
  stylesheet = fileadmin/templates/css/print.css
  typeNum = 98
  1 = TEXT
  1 {
    field = title
    wrap = <p>Seite: |<br />
  }
  2 = TEXT
  2 {
    field = author
    required = 1
    typolink.parameter.field = author_email
    wrap = Autor: |<hr /></p>
  }
  3 = CONTENT
  3 < styles.content.get
  4 = HTML
  4 {
    value = <p><hr /><a href="javascript:print();" title="Seite drucken">Seite drucken</a></p>
  }
}

#Link zum Drucken
lib.printlink = TEXT
lib.printlink {
  value = Seite drucken
  postUserFunc = tx_make_printlink
  postUserFunc.include_post_vars = 1
  postUserFunc.target = _blank
  postUserFunc.popup = 1
  postUserFunc.windowname = Druckvorschau
  #kein Zeilenumbruch zwischen Klammern und Angaben
  postUserFunc.windowparams = (resizable=yes,toolbar=yes,scrollbars=yes,menubar=yes,width=800,height=500)
}

Meine localconf.php schaut so aus:

$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'] = array(
	'init' => array(
		'enableCHashCache' => 1,
		'appendMissingSlash' => 'ifNotFile',
		'enableUrlDecodeCache' => 1,
		'enableUrlEncodeCache' => 1,
	),
	'preVars' => array(
		array(
			'GETvar' => 'no_cache',
			'valueMap' => array(
				'no_cache' => 1,
			),
			'noMatch' => 'bypass',
		),
		array(
			'GETvar' => 'L',
			'valueMap' => array(
				'de' => '0',
			),
			'valueDefault' => 'de',
		),
		array(
			'GETvar' => 'fsize',
			'valueMap' => array(
				'n' => '0',
				'm' => '1',
				'l' => '2',
			),
			'valueDefault' => 'n',
		),
	),
	'fileName' => array (
		'defaultToHTMLsuffixOnPrev'=> true,
		'index' => array(
			'print' => array(
				'keyValues' => array(
					'type' => '98',
				)
			),
		),
	),
	'pagePath' => array(
		'type' => 'user',
		'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
		'spaceCharacter' => '_',
		'languageGetVar' => 'L',
		'expireDays' => 3,
		'rootpage_id' => 1,
	),
	'postVarSets' => array (
		'_DEFAULT' => array (
			'archive' => array (
				'0' => array (
					'GETvar' => 'tx_ttnews[year]',
				),
				'1' => array (
					'GETvar' => 'tx_ttnews[month]',
					'valueMap' => array (
						'january' => '01',
						'february' => '02',
						'march' => '03',
						'april' => '04',
						'may' => '05',
						'june' => '06',
						'july' => '07',
						'august' => '08',
						'september' => '09',
						'october' => '10',
						'november' => '11',
						'december' => '12',
					),
				),
			),
			'browse' => array (
				'0' => array (
					'GETvar' => 'tx_ttnews[pointer]',
				),
			),
			'select_category' => array (
				'0' => array (
					'GETvar' => 'tx_ttnews[cat]',
				),
			),
			'article' => array (
				'0' => array (
					'GETvar' => 'tx_ttnews[tt_news]',
					'lookUpTable' => array (
						'table' => 'tt_news',
						'id_field' => 'uid',
						'alias_field' => 'title',
						'addWhereClause' => ' AND NOT deleted',
						'useUniqueCache' => '1',
						'useUniqueCache_conf' => array (
							'strtolower' => '1',
							'spaceCharacter' => '-',
						),
					),
				),
				'1' => array (
					'GETvar' => 'tx_ttnews[swords]',
				),
			),
		),
	),
);

Meine Links haben dieses aussehen:
http://www.domain.de/de/n/startseite.html

Mein Link zum Drucken sieht so aus:
http://www.domain.de/de/n/startseite/print?amp%3BL=0&%3Bfsize=0

Kann mir jemand sagen, warum am Ende des Links so ein Kauderwelsch angehangen wird? Also du siehst schon richtig, lauter Prozentzeichen etc.... Wie kann man dies verhindern bzw. verbessern? Ich freue mich über jede Antwort 🙂

Viele Grüße
dabjoern

dabjoern ·

Hi auch,

Problem gelöst. Ich denke, es liegt an der Reihenfolge der Elemente/dem Aufbau der localconf.php. Ich habe es jetzt so:

$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'] = array(
	'init' => array(
		'enableCHashCache' => 1,
		'appendMissingSlash' => 'ifNotFile',
		'enableUrlDecodeCache' => 1,
		'enableUrlEncodeCache' => 1,
	),
	'redirects' => array(),
	'preVars' => array(
		array(
			'GETvar' => 'no_cache',
			'valueMap' => array(
				'nc' => 1,
			),
			'noMatch' => 'bypass',
		),
		array(
			'GETvar' => 'L',
			'valueMap' => array(
				'de' => '0',
			),
			'valueDefault' => 'de',
		),
		array(
			'GETvar' => 'fsize',
			'valueMap' => array(
				'n' => '0',
				'm' => '1',
				'l' => '2',
			),
			'valueDefault' => 'n',
		),
	),
	'pagePath' => array(
		'type' => 'user',
		'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
		'spaceCharacter' => '-',
		'languageGetVar' => 'L',
		'expireDays' => 7,
		'rootpage_id' => 1,
	),
	'fixedPostVars' => array(),
	'postVarSets' => array (
		'_DEFAULT' => array (
			'archiv' => array (
				'0' => array (
					'GETvar' => 'tx_ttnews[year]',
				),
				'1' => array (
					'GETvar' => 'tx_ttnews[month]',
					'valueMap' => array (
						'januar' => '01',
						'februar' => '02',
						'maerz' => '03',
						'april' => '04',
						'mai' => '05',
						'juni' => '06',
						'juli' => '07',
						'august' => '08',
						'september' => '09',
						'oktober' => '10',
						'november' => '11',
						'dezember' => '12',
					),
				),
			),
			'browse' => array (
				'0' => array (
					'GETvar' => 'tx_ttnews[pointer]',
				),
			),
			'kategorie' => array (
				'0' => array (
					'GETvar' => 'tx_ttnews[cat]',
				),
			),
			'artikel' => array (
				'0' => array (
					'GETvar' => 'tx_ttnews[tt_news]',
					'lookUpTable' => array (
						'table' => 'tt_news',
						'id_field' => 'uid',
						'alias_field' => 'title',
						'addWhereClause' => ' AND NOT deleted',
						'useUniqueCache' => '1',
						'useUniqueCache_conf' => array (
							'strtolower' => '1',
							'spaceCharacter' => '-',
						),
					),
				),
				'1' => array (
					'GETvar' => 'tx_ttnews[swords]',
				),
			),
		),
	),
	'fileName' => array (
		'defaultToHTMLsuffixOnPrev'=> true,
		'index' => array(
			'print' => array(
				'keyValues' => array(
					'type' => '98',
				)
			),
		),
	),
);

Damit klappt alles wunderbar.

Viele Grüße
dabjoern

dabjoern ·

Hallo Leute,

nein klappt doch nicht. Ich war auf der Startseite. Dort wird an den Printlink nichts angehangen. Ich habe zwar noch einen kleinen Fehler gefunden (es muss print.html und nicht nur print heißen), jedoch sehen meine Links immer noch so bescheiden aus.

'fileName' => array (
	'defaultToHTMLsuffixOnPrev'=> true,
	'index' => array(
		'print.html' => array(
			'keyValues' => array(
				'type' => '98',
			)
		),
	),
),

Hat jemand eine Idee?

Grüße
dabjoern