0
votes

I'm using Typo3 6.2 LTS and I try to create a Controller for my Fluidcontent plugin. I used EXT:builder to generate my extension and inside the Resources/Private/templates/Content folder I create a HTML file containing my FCE definition. That works nice. I can choose it in the backend to create a custom content element. Now I need to manipulate some values a user entered into the backend form. As far as I know, I have to use the Classes/Controller/Content.php to do that. This controller is defined as follow:

<?php

class ContentController extends \FluidTYPO3\Fluidcontent\Controller\AbstractContentController {

    public function initializeView(ViewInterface $view) {
        parent::initializeView($view);
    }

    public function textBackgroundImageAction() {
        $this->view->assign('special', 'Test');
    }
}

This is just a small test. My template file is Resources/Private/Templates/Content/TextBackgroundImage.html so the action name should be ok. But if I try to output this in my Main part of my Template file, nothing is displayed. I also tried to override the initializeView(ViewInterface $view) method.

<div class="container">
    {special}
</div>

I didn't change anything on ext_tables.php. That is my content:

<?php
if (!defined('TYPO3_MODE')) {
    die ('Access denied.');
}

TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript', 'FCEs');

\FluidTYPO3\Flux\Core::registerProviderExtensionKey('fce_sanifair', 'Content');

Now I'm wondering why nothing is displayed if I assign a new varibale to the view. Does anyone have some infomation about this?

I thank you in advance.

1

1 Answers

0
votes

I had the same problem. After creating a file in the extension folder under => Migrations/Code/ClassAliasMap.php with this code

<?php
return array (
    'Tx_Extkey_Controller_ContentController' => 'YourVendorName\\Extkey\\Controller\\ContentController',
);

the action method in the ContentController is called successfully.

This is also documented here.

My problem after solving this is to register a custom PageController ;-(