[TYPO3-english] pdf_generator2 + realurl

Bernhard Kraft kraftb at kraftb.at
Wed Oct 28 14:35:18 CET 2009


De Contardi Riccardo schrieb:

> lib.convertPDF = TEXT
> lib.convertPDF.value= GET PDF!
> lib.convertPDF.postUserFunc = tx_pdfgenerator2->makePdfLink
> lib.convertPDF.postUserFunc.target =

I recently had to fix a site using pdfgenerator2 and realURL. As the pdfgenerator2
extension does not seem to be aware of realURL (and the TYPO3 typoLink link-generating
method) I simply created the link using the following TS:

lib.convertPDF = TEXT
lib.convertPDF.value= GET PDF!
lib.convertPDF.typolink = 1
lib.convertPDF.typolink {
	parameter.dataWrap = {TSFE:id},123
}

This should generate the appropriate link. If you like you could also apply the following
patch to realURL:

http://think-open.org/kraftb/index/misc/realurl_suffix_patch.diff

It allows you to have something like the following in your realURL config:

------------------------------------------------------------------
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'] = Array(
[...]
	'fileName' => array (
		'defaultToHTMLsuffixOnPrev'=> array(
			'.pdf' => array(
				'keyValues' => array(
					'type' => 123,
				),
			),
			'.rss' => array(
				'keyValues' => array(
					'type' => 100,
				),
			),
			'.htm' => array(
				'keyValues' => array(
					'type' => 98,
				),
			),
			'.html' => array(
				'keyValues' => array(
				),
			),
		),
	),
[...]
);
------------------------------------------------------------------

Usually the option "defaultToHTMLsuffixOnPrev" (boolean) allows you to have links like:

http/mysite.com/company/about_us.html
instead of
http/mysite.com/company/about_us/

So to append the ".html" suffix instead of just a "/" at the end. The above patch
and configuration will append the appropriate suffix depending on the variables set
in "keyValues" sub-config array. The configuration is the same as for "fileName|index"


I'll send this patch proposal to Dmitry, so it probably can get included in future
versions of realURL.


greets,
Bernhard


More information about the TYPO3-english mailing list