[TYPO3-dev] Add Footer Data in Extbase

Henjo Hoeksma me at henjohoeksma.nl
Wed Dec 21 16:52:53 CET 2011


Hi Bernd,

why not use TypoScript?

If you want to do it from within your extension you could use the
initializeAction in a Abstract Controller you use as a base controller for
your own controllers and do it something like this:

<code>
    public function initializeAction() {
if(TYPO3_MODE == 'FE') {
    // Add CSS
    $cssFile = $this->settings['css'];
    if ($cssFile) {
$GLOBALS['TSFE']->getPageRenderer()->addCssFile ($cssFile, $rel=
'stylesheet', $media= 'all', $title= '', $compress=TRUE, $forceOnTop=FALSE,
$allWrap= '');
    }
    // Add JS
    $jsFile = $this->settings['js'];
    $jsValidation = $this->settings['jquery-validate'];
    if ($jsFile && $jsValidation) {
 $GLOBALS['TSFE']->getPageRenderer()->addJsFooterFile ($jsValidation,
$type= 'text/javascript', $compress=TRUE, $forceOnTop=FALSE, $allWrap= '');
 $GLOBALS['TSFE']->getPageRenderer()->addJsFooterFile ($jsFile, $type=
'text/javascript', $compress=TRUE, $forceOnTop=FALSE, $allWrap= '');
    }
}
 parent::initializeAction();
    }
</code>
Kind regards,

Henjo

Problems are small because we learned how to deal with them.
Problems are big because we need to learn how to deal with them.


On Wed, Dec 21, 2011 at 14:55, Bernd Schönbach
<bs.newsfeeds at googlemail.com>wrote:

> Hi,
>
> I would like to add some JavaScript belonging to an extbase extension to
> the footer of the page (right before the closing body tag). Is there any
> way to achieve this in extbase?
>
> Thanks
> Bernd
> ______________________________**_________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.typo3.org
> http://lists.typo3.org/cgi-**bin/mailman/listinfo/typo3-dev<http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-dev>
>



More information about the TYPO3-dev mailing list