[TYPO3-dev] CommandController, RTE, render and missing Links

Kai Szymanski kai at szymanski.de
Fri Nov 8 14:33:34 CET 2013


Hi!

I've written a CommandController that walsk thru a table, fetch Items and send them by mail.

The configuration of the "Messagefield" is:

        'message' => array(
            'exclude' => 0,
            'label' => 'LLL:EXT:myext/Resources/Private/Language/Locallang_db.xml:tx_myext_domain_model_message.message',
            'config' => array(
                'type' => 'text',
                'rows' => 5,
                'cols' => 80,
                'wizards' => array(
                    '_PADDING' => 2,
                    'RTE' => array(
                        'notNewRecords' => 1,
                        'RTEonly'       => 1,
                        'type'          => 'script',
                        'title'         => 'Full screen Rich Text Editing',
                        'icon'          => 'wizard_rte2.gif',
                        'script'        => 'wizard_rte.php',
                    ),
                ),
            )
        ),

and

    'types' => array(
        '1' => array([...]message;;;richtext[bold|italic|subscript|superscript|link|cut|copy|paste|chMode]:rte_transform[mode=ts_css])
    ),

Everything works fine (if i examine the data that was saved into table i see things like <link file:71>Link</link>).

Then i try to render a email. My Utility-Class:

<?php
namespace Myext\Utility;

use TYPO3\CMS\Core\Utility\GeneralUtility;

class RenderTemplateUtility {

    /**
     * @param $templateName
     * @param array $args
     * @return string
     */
    public static function renderTemplate($templateName, $args = array()) {

        $messageView = self::getFluidRenderer($templateName);
        $messageView->assignMultiple($args);
        return $messageView->render();
    }

    /**
     * Creates a fluid instance with template-file and controller-settings.

     * @param \string $file Path below Template-Root-Path
     * @return \TYPO3\CMS\Fluid\View\StandaloneView Fluid-Template-Renderer
     */
    protected function getFluidRenderer($file) {

        $renderer = GeneralUtility::makeInstance('TYPO3\\CMS\\Fluid\\View\\StandaloneView');
        /* @var $renderer \TYPO3\CMS\Fluid\View\StandaloneView */

        $renderer->setTemplatePathAndFilename($file);
        return $renderer;
    }
}

Also here everything works "near" fine. But the link will not be rendered.

The saved data in field message is:

<b>This</b> <i>is a </i><link file:71>LINK</link> !!

I try to use the follwoing templates:

1)

<f:format.html parseFuncTSPath="lib.parseFunc_RTE">{message}</f:format.html><br />

2)

<f:format.html parseFuncTSPath="lib.parseFunc">{message}</f:format.html><br />

When i use my "RenderUtility" i get as output:

<b>This</b> <i>is a </i> !!

The complete "link section" is missing.

I search for a solution buit can't find any...maybe a forumuser can help me ? :)

Best regards,
  Kai.
  



More information about the TYPO3-dev mailing list