1

i'm updating a project from TYPO3

  • 6.x to 7.x
  • 7.x to 8.7

im already on 8.7 and now working on the extensions. we have a pibase extension were the support should be still available in 8.7

i've refactored a few things already:

  • i replaced the old classes with the new namespaces based on the ClassAliasMap.php
  • i've adapted the new TCA approach with Configuration/TCA/Overrides
  • changed from $TCA to $GLOBALS['TCA']

another task will be to rework the templates from css_styled_content to fluid_styled_content. but i'm not right there because im stuck to get the plugin be available in Template>RootPage>Info/Modify>Edit-whole-template>Includes. its just not in the "available items" list.

i thought there are 2 steps do get this done

register the plugin for frontend rendering with

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43($_EXTKEY, 'pi1/class.tx_rxextkey_pi1.php', '_pi1', 'list_type', FALSE);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43($_EXTKEY, 'pi2/class.tx_rxextkey_pi2.php', '_pi1', 'list_type', FALSE);

and make the plugin selectable in the backend with

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(
array('LLL:EXT:rx_extkey/Resources/Private/Language/locallang_db.xml:tt_content.list_type_pi1',
     'rx_extkey_pi1',
     \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('rx_extkey') . 'ext_icon.png'
     ),
     'list_type',
     'rx_extkey'
    );

heres how the extension/plugin is structured generally:

myextension
- configuration/
  - TCA/
   - Overrides/
     tt_content.php
- doc/
  wizard_form.dat
  wizard_form.html
- eId/
  classX.php
  classO.php
  classL.php
- pi1/
  class.tx_myextension_pi1.php
  flexform_ds.xml
  locallang.xml
- pi2/
  class.tx_myextension_pi1.php
  flexform_ds.xml
  locallang.xml
- res/
  something.html
  somethingelse.html
ext_emconf.php
ext_icon.gif
ext_localconf.php
ext_tables.php
locallang_db.xml

so inside the ext_localconf i call addPItoST43 from the ExtensionManagementUtility to actually add the class files

the emconf is just "default" so to speak and a description of the plugin

the file ext_tables.php is empty now because all the stuff from in there moved to the Configuration/ part

the parts i moved to tt_content.php inside the Configuration/ directory contain 2 TCA Overrides with $GLOBALS['TCA']['tt_content']['types'] and $GLOBALS['TCA']['tt_content']['columns'] followed by 3 addPlugin calls also from the ExtensionManagementUtility

so with all this done i still cant include the plugin within the root page to get the actual functionality - i have no idea how to further process to get this to work - any help is much appreciated, if any further information or code is needed just drop a comment

further investigation: so i have debugged like every part of the extension and the part for the backend seems to work just fine, i see the plugin content and can select pieces out of the database to theoretically display in the frontend. the only thing is that TYPO3 never comes into my class tx_extkey_pi1 to actually fill the template with content - i have var_dumps() with exit() in both main() and renderTemplate() but they get never triggered.

netzding
  • 772
  • 4
  • 21
  • Where is the TypoScript in your structure? – Thomas Löffler May 15 '19 at 21:21
  • @ThomasLöffler there is no specific TypoScript in the plugins/extensions structure - we have a bunch at fileadmin/templates/ts – netzding May 16 '19 at 07:08
  • A plugin is called via TypoScript. When it's not called, it's not running. – Thomas Löffler May 16 '19 at 08:16
  • is that also the case if im already able to choose it as content-type for a page? i guess i have to double check for typoscript ? – netzding May 16 '19 at 09:03
  • 1
    @ThomasLöffler doesent that work with the ::addPItoST43 method inside ext_localconf? – netzding May 16 '19 at 09:58
  • The 2 addPItoST43 commands must be distinct and not use '_pi1'. The second must use '_pi2'. The file 'class.tx_myextension_pi1.php' is duplicate! And it must match to the addPItoST43 command file 'class.tx_rxextkey_pi2.php'. – Franz Holzinger Dec 26 '19 at 21:45

1 Answers1

0

Ich think this part

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(
array('LLL:EXT:rx_extkey/Resources/Private/Language/locallang_db.xml:tt_content.list_type_pi1',
     'rx_extkey_pi1',
     \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('rx_extkey') . 'ext_icon.png'
     ),
     'list_type',
     'rx_extkey'
    );

belongs in ext_tables.php

G-Agnes
  • 66
  • 8
  • 1
    im pretty sure that since 6.x that has to be in the tt_content.php file inside the TCA Override directories – netzding May 16 '19 at 07:14
  • Maybe you should use `\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin()' in `Configuration/TCA/Overrides/tt_content.php` instead of addPlugin. https://docs.typo3.org/typo3cms/ExtbaseFluidBook/4-FirstExtension/7-configuring-the-plugin.html – G-Agnes May 16 '19 at 15:08
  • on another task at the moment - i will try that later that day - thanks for input – netzding May 17 '19 at 09:25