简体   繁体   中英

Creating a FrontEnd Plugin in Typo3 7.6

I know there are multiple Threads with a similar Question but I hope that someone can give me an individual solution.

So I am working on an Existing Typo3 7.6.23 Project with already multiple plugins running, I tried to copy every instance that I could find to replicate a plugin and customize it for my use. That didn't work. I couldn't see the Plugin in the Dropdown List.

Then I tried to follow the steps from this link .
(1) registerPlugin

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
    $_EXTKEY,
    'DocumentService',
    'DokumentenService'
);

(2) configurePlugin

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
     'TYPO3.' . $_EXTKEY, 'DocumentService', array(
          'Example' => 'showDocumentService',
      ),
      // non-cacheable actions
      array(
         'Example' => '',
      )
);

I should be able to select the Plugin in the Backend Dropdown List. But it just does not appear in my Plugins List in the Content Element where I need it.

I even created a Template in the Right Folder and created an Action for it in the Controller..

I'm stuck here and would love to hear a solution as soon as possible.

You are writing about about a service.... Ist the extension just a typo3 Service, you won't be able to select it as extension in the backend... Have a look at "ext_localconf..." Is there a \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addService(... Then the extension could be just a service.

Here is a working sample from Aimeos Webshop. Please note you have to change the name of the plugin, you should not use TYPO3. or Aimeos. for the plugin name instead choose your own name.

configurePlugin example from https://github.com/aimeos/aimeos-typo3/blob/2018.04/ext_localconf.php#L27 , this configures your plugin for the frontend:

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
    'Aimeos.' . $_EXTKEY,
    'locale-select',
    array( 'Locale' => 'select' ),
    array( 'Locale' => 'select' )
);

registerPlugin example https://github.com/aimeos/aimeos-typo3/blob/2018.04/ext_tables.php#L60 , this shows your plugin in the backend:

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
    'Aimeos.' . $_EXTKEY,
    'locale-select',
    'Aimeos Shop - Locale selector'
);

And here is the entry point of the action https://github.com/aimeos/aimeos-typo3/blob/2018.04/Classes/Controller/LocaleController.php#L27

The Extension Builder can help you to setup a new TYPO3 extension and is available for TYPO3 v7.6 too see https://extensions.typo3.org/extension/extension_builder/ .

And finally here is the documentation on writing extensions for TYPO3 v7.6 https://docs.typo3.org/m/typo3/reference-coreapi/7.6/en-us/ExtensionArchitecture/Index.html .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM