[TYPO3-german] Ext:news - PDF (relatedFile) in neuem Fenster ffnen ???

MB-Süd mbsued.ma4 at augsburg.de
Wed Feb 3 14:52:17 CET 2016


Hallo Johannes,

die Version hab ich im Einsatz und bei mir geht es. Schau dir mal diesen ViewHelper an: FileDownloadViewHelper (in Classes/viewhelper/format). Er hat als Parameter target:

class Tx_News_ViewHelpers_Format_FileDownloadViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper {

	/**
	 * Download a file
	 *
	 * @param string $file Path to the file
	 * @param array $configuration configuration used to render the filelink cObject
	 * @param boolean $hideError define if an error should be displayed if file not found
* 	 * @param string $class optional class
* 	 * @param string $target target
* 	 * @param string $alt alt text
* 	 * @param string $title title text
	 * @return string
	 * @throws \TYPO3\CMS\Fluid\Core\ViewHelper\Exception\InvalidVariableException

Einfach diesem Viewhelper beim Aufruf ein target="_blank" mitgeben und schon gehts du kann auch zusätzliche Klassen mit angeben( so dass vor deine Files z.B. das jeweilige Symbol kommt).

<n:format.fileDownload file="{relatedFile.file}" configuration="{settings.relatedFiles.download}" target="_blank">
<f:if condition="{relatedFile.title}">
<f:then><f:format.raw>{relatedFile.title}</f:format.raw>
</f:then>
<f:else>{relatedFile.file}
</f:else>
</f:if>
</n:format.fileDownload>

Soll ich dir mal mein template schicken?

Gruß
Hans


More information about the TYPO3-german mailing list