SL5net
SL5net

Reputation: 2556

TYPO3 CMS 9.5.5 most simple extension

I have to create a simple TYPO3 extension for version 9.5.5.

i installed TYPO3 CMS 9.5.5 from https://bitnami.com/stack/typo3

in docu for latest (9-dev) https://docs.typo3.org/typo3cms/CoreApiReference/ExtensionArchitecture/FilesAndLocations/Index.html they say "usually located in typo3conf/ext for local extensions, or typo3/sysext for system extensions."

i dont have a "typo3conf/ext", no "typo3conf" and "typo3/ext" . and yes there is a "typo3/sysext".

I have not found a guide online that takes this fact into account.

Then i read "... there is a tool which makes it easier to start. It is called Extension builder" ( https://docs.typo3.org/typo3cms/CoreApiReference/ExtensionArchitecture/CreateNewExtension/Index.html )

Ttherefore I have installed this "Extension Builder" via Zip from https://extensions.typo3.org/extension/extension_builder/

  1. Download ZIP file
  2. Log into your TYPO3 backend
  3. Go to Extension Manager module
  4. Press the upload button on the top bar
  5. Select the ZIP file and upload it.

and with me it looks very different as in the documentation: screenshot "Extension Builder"

then i read "Docs » Creating a first extension » Create Folder Structure And Configuration Files" (https://docs.typo3.org/typo3cms/ExtbaseFluidBook/4-FirstExtension/2-create-folder-structure-and-configuration-files.html)

There they talk about "unique identifier of our extension". whats this? "as store_inventory". whats this?

anyway.

and "These are in the folder typo3conf/ext/"

but this folder does not exist in my installation.

I then looked into an installation of another computer days later and there was this folder also not.

anyway.

i created then "typo3conf/ext/store_inventory" (as described there).

then I wondered about the following formulation:

"The name of this folder must be written like the extension key" So this folder probably had to be different named?

then i found this folder structure at the same page:

https://docs.typo3.org/typo3cms/ExtbaseFluidBook/_images/figure-4-1.png

and I wondered a lot about the amount of folders and files.

I just wanted to make a simple extension that just lists files.

I thought that's a few lines of source code.

is not that any easier?

I do not need all these things like eg. ext_icon.gif. i hope i do not need to create all that files and folder manually.

Upvotes: 1

Views: 676

Answers (1)

TYPO3 Freelancer
TYPO3 Freelancer

Reputation: 106

Here are some answers:

The extension key is the name of your folder inside of "typo3conf/ext". I recommend not using an underscore because it might be confusing for you later on as a beginner with TYPO3. Choose a simple and short name. To make sure the name is not available already, please check "extensions.typo3.org" to see if the key (extension name) is already taken. If you want to be 100% sure, you have to register an account there and register the extension key officially. This is all free of course.

The file ext_icon.gif is indeed not necessary, but looks nice when your extension is shown in the list of extensions in the Extension Manager of TYPO3.

You say you want to "list files". I guess you are talking about static files like images etc. that you have in your fileadmin folder already?

So in this case you need a minimum folder structure like this:

store_inventory
    Classes
        Controller
            StoreController.php (Contains PHP function "filesList")
    Configuration
        TypoScript
    Resources
        Private
            Templates
                Files.html (Contains HTML/Fluid-Code for Frontend)
    ext_emconf.php (Contains necessary information about your Ext.)
    ext_localconf.php (Contains registration of Frontend-Plugin/Controller)

A more detailed answer requires more information about your extension's exact requirements. Here are some more links that I think you might need for this project:

ext_emconf.php https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ExtensionArchitecture/DeclarationFile/Index.html#

ext_localconf.php https://docs.typo3.org/m/typo3/book-extbasefluid/master/en-us/4-FirstExtension/7-configuring-the-plugin.html

Controllers and Actions: https://docs.typo3.org/m/typo3/book-extbasefluid/master/en-us/7-Controllers/1-Creating-Controllers-and-Actions.html

Your Controller needs to have a function called for instance "fileAction" and the template file for this "Action" must be named "File.html" in order to work. If you name the action "fileListAction", your template file must be named "FileList.html" and so on...

There are some other small things to think about, but I don't know enough about your exact requirements. If you have any trouble, don't hesitate to ask more questions!

I know, TYPO3 can be frustrating. I do it for decades already ;)

Good luck

Upvotes: 1

Related Questions