Zum Inhalt springen

EIgene Extension switchable Controller Actions

Erstellt am 26. November 2013 · 5 Antworten · letzte Antwort am 27. November 2013

Tags: TYPO3 6.x, Frage

typo3_hp ·

Hallo ich habe unter Typo3 6.1.5 die erste Extension mittels Fluid (Extension_Builder) erstellt.

Nun würde ich gerne auf der Startseite eine spezielle Action im Plugin einfügen, habe aber kein Dropdownfeld zur Auswahl der Action im Plugin.

Folgendes habe ich gemacht:

ext_localconf.php:

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
	'CGS.' . $_EXTKEY,
	'Cpgbusjourneys',
	array(
		'Journeys' => 'list, show, book, toppush, startselect',
	),
	// non-cacheable actions
	array(
		'Journeys' => 'list, book, toppush, startselect',
	)
);

ext_tables.php:

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
	$_EXTKEY,
	'Cpgbusjourneys',
	'cpg_bus_journeys'
);

# Flexform selection
$pluginSignature = str_replace('_','',$_EXTKEY) . '_register';
$TCA['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
t3lib_extMgm::addPiFlexFormValue($pluginSignature, 'FILE:EXT:' . $_EXTKEY . '/Configuration/FlexForms/flexform.xml');

und /Configuration/FlexForms/flexform.xml:

 <T3DataStructure>
  <sheets>
    <sDEF>
      <ROOT>
        <TCEforms>
          <sheetTitle>Verhalten</sheetTitle>
        </TCEforms>
        <type>array</type>
        <el>
          <switchableControllerActions>
            <TCEforms>
              <label>Standardaktion des Plugins</label>
              <config>
                <type>select</type>
                <items>
                   <numIndex index="0">
                     <numIndex index="0">Listenansicht</numIndex>
                     <numIndex index="1">Journeys->list</numIndex>
                   </numIndex>
                   <numIndex index="1">
                     <numIndex index="0">Einzelansicht</numIndex>
                     <numIndex index="1">Journeys->show;Journeys->edit;Journeys->update</numIndex>
                   </numIndex>
                 </items>
              </config>
            </TCEforms>
          </switchableControllerActions>
        </el>
      </ROOT>
    </sDEF>
  </sheets>
</T3DataStructure>

Was habe ich falsch gemacht?

LG und Danke!

Schweriner · · Beste Antwort

Ich vermute deine Flexform wird nicht richtig eingebunden. Füg nochmal ein weiteres Beispielfeld ein und guck obs angezeigt wird.

So oder so glaube ich es müsste in der ext_tables so lauten:

$pluginSignature = str_replace('_','',$_EXTKEY) . '_cpgbusjourneys';

typo3_hp ·

OK ;-)

Jetzt habe ich es hinbekommen auf der Startseite das Plugin toppush einzufügen. Nun habe ich dort aber keine Daten und es kommt die Meldung

"An error occurred while trying to call CGS\CpgBusJourneys\Controller\JourneysController->showAction()"

obwohl ich hier die toppush eingefügt habe und diese gar nichts direkt mit der show zu tun hat...!?
Will ich zwar später auf die show verweisen, habe ich aber noch nichts gemacht!

Auszug aus JourneysController.php:

/**
	 * action toppush
	 *
	 * @dontvalidate $variable
     * @dontverifyrequesthash 
	 * @return void
	 */
	public function toppushAction() {
		$this->view->assign('journeys', $this->journeysRepository->findAll());
	}

Wenn ich die Listansicht aus der Flexliste auswähle, passt alles :-(

Mein Auszug flexform.xml:

<items>
                   <numIndex index="0">
                     <numIndex index="0">Listenansicht</numIndex>
                     <numIndex index="1">Journeys->list</numIndex>
                   </numIndex>
                   <numIndex index="1">
                     <numIndex index="0">Startseite Pushreisen</numIndex>
                     <numIndex index="1">Journeys->toppush</numIndex>
                   </numIndex>
                 </items>

Habe die letzten 30 Min alles mögliche ausprobiert, aber scheinbar ohne Erfolg.

Was läuft da falsch?

Danke und LG

Schweriner ·

Mh sehr komisch. Erstmal würde ich in ext tables, ext_localconf und Flexform alle Dinge entfernen, die auf die showAction verweisen oder eine hinzugefügen und dann debuggen. Auch unbedingt mal alle Caches leeren.