From ca8197a4de0858d084553b648f8dc389d69b485b Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Mon, 5 Nov 2018 09:20:34 +0100 Subject: [PATCH] TASK: Update docs pre workshop --- Documentation/source/AddFirstPlugin.rst | 4 ++- Documentation/source/Configuration.rst | 4 ++- Documentation/source/CustomRecords.rst | 34 +++++++++++++++++-- Documentation/source/Extension.rst | 8 ++--- Documentation/source/Outlook.rst | 2 -- .../source/Outlook/Coding-Guideline.rst | 2 -- .../Outlook/Fluid/Concepts-of-Models.rst | 2 -- Documentation/source/StartNewExtension.rst | 14 +++++--- Documentation/source/index.rst | 4 ++- 9 files changed, 55 insertions(+), 19 deletions(-) delete mode 100644 Documentation/source/Outlook/Coding-Guideline.rst delete mode 100644 Documentation/source/Outlook/Fluid/Concepts-of-Models.rst diff --git a/Documentation/source/AddFirstPlugin.rst b/Documentation/source/AddFirstPlugin.rst index 280f41d..dc8328a 100644 --- a/Documentation/source/AddFirstPlugin.rst +++ b/Documentation/source/AddFirstPlugin.rst @@ -1,3 +1,5 @@ +.. _add-first-plugin: + Add first Plugin ================ @@ -16,7 +18,7 @@ Still Plugins are a very typical thing to bring in features to your website. The Plugin ---------- -We will start with a very basic plugin that will display a hardcoded string. +As mentioned, we will start with a simple example plugin to display "Hello World". Register Plugin in Backend -------------------------- diff --git a/Documentation/source/Configuration.rst b/Documentation/source/Configuration.rst index aec127b..01d6fe6 100644 --- a/Documentation/source/Configuration.rst +++ b/Documentation/source/Configuration.rst @@ -95,7 +95,7 @@ book. The whole ``settings`` array is passed into all templates, layouts and partials. This way it's possible for integrators to provide arbitary information. - E.g. introduce a new namespace:: + E.g. introduce a new namespace ``codappix`` with project specific settings:: plugin { tx_exampleextension { @@ -203,6 +203,8 @@ we can pre select the plugin. See: https://docs.typo3.org/typo3cms/TSconfigReference/PageTsconfig/Mod.html#wizards +Available TYPO3 Icons can be found here: https://typo3.github.io/TYPO3.Icons/ + .. _configuration-view-paths: Adjusting view paths diff --git a/Documentation/source/CustomRecords.rst b/Documentation/source/CustomRecords.rst index 0b83409..8213598 100644 --- a/Documentation/source/CustomRecords.rst +++ b/Documentation/source/CustomRecords.rst @@ -17,7 +17,7 @@ TCA Before we can do anything with Extbase, we need to configure TYPO3. The TCA (=Table Configuration Array) contains configuration for each database table. TYPO3 will -generate the list view and edit forms from this configuration. +generate the list view and edit forms within the Backend from this configuration. Extbase uses this configuration for mapping and database queries, together with relation handling. @@ -49,6 +49,9 @@ Our new record will be an address record with the following fields: * Country +Once we finished the TCA, we already can create new records. Only saving them does +not work, as we didn't setup the database yet. + .. note:: By default new records are only allowed on pages of type "Folder". @@ -75,6 +78,7 @@ The example :file:`ext_tables.sql` is: .. literalinclude:: ../../CodeExamples/localPackages/example_extension/ext_tables.sql :language: sql + :linenos: All further TYPO3 specific fields, like ``uid`` and ``pid`` are added by TYPO3 CMS since v9. @@ -106,6 +110,9 @@ Before v9, the file would look like: KEY parent (pid) ); +We should now be able to create and save new records within the TYPO3 backend. Also +existing records should be listed, searchable and editable. + Model ----- @@ -119,7 +126,7 @@ our case this has to match the table name and is called ``Workshop\ExampleExtension\Domain\Model\Address`` and located at :file:`Classes/Domain/Model/Address.php`. -Each model is a PHP class structure like: +Each model is a PHP class, structured like: .. literalinclude:: ../../CodeExamples/localPackages/example_extension/Classes/Domain/Model/Address.php :language: php @@ -213,3 +220,26 @@ We could also configure the pid via TypoScript: } } +Add new plugin +-------------- + +You might have noticed that the above controller is not the same as in our first +example. We therefore can add the controller to the existing plugin or add a new +plugin for this controller. + +I would recommend to create a new plugin, to separate things. The process is not +explained again. If you struggle, take a look at :ref:`add-first-plugin` again. + +Check everything +---------------- + +Once everything is set up, the following should be possible: + +* Create, edit, search and delete records within TYPO3 Backend. + +* List available records via Frontend Plugin. + +Sounds like a lot of work for a small benefit? Right. If all you have to achieve is +this, you should not use Extbase but "pure" TYPO3. But we will extend the Extension +in the next step. Also this is about a first simple Extbase Extension, not how to use +TYPO3 the right way. diff --git a/Documentation/source/Extension.rst b/Documentation/source/Extension.rst index 7ca2935..27bf01e 100644 --- a/Documentation/source/Extension.rst +++ b/Documentation/source/Extension.rst @@ -12,11 +12,11 @@ TYPO3 is built only with extensions, there is no framework below. All features a assigned to a specific extension. This way it's possible to build the TYPO3 that fits the project needs. -An extension is something like `frontend` or `backend`, which provides the TYPO3 -frontend or backend. It can also be `extbase` or `fluid` which provides and Framework -to build further extensions or an template engine. +An extension is something like ``frontend`` or ``backend``, which provides the TYPO3 +frontend or backend. It can also be ``extbase`` which works as an Framework +to build further extensions or ``fluid`` an template engine. -Nowadays most installations also have a `site_` or `sitepackage` extensions, which +Nowadays most installations also have a ``site_`` or ``sitepackage`` extensions, which encapsulates the systems configuration and resources like assets and templates. Thus an TYPO3 extension is the same as an composer package. diff --git a/Documentation/source/Outlook.rst b/Documentation/source/Outlook.rst index f555f13..cd71cc3 100644 --- a/Documentation/source/Outlook.rst +++ b/Documentation/source/Outlook.rst @@ -11,9 +11,7 @@ If we have some time left, we can take a deeper look at some of these topics. Outlook/Dependency-Injection Outlook/Automated-Testing Outlook/Property-Mapper - Outlook/Coding-Guideline Outlook/Command-Controllers Outlook/Backend-Modules Outlook/Fluid/Custom-ViewHelper - Outlook/Fluid/Concepts-of-Models Outlook/Configuration/Mapping-DB diff --git a/Documentation/source/Outlook/Coding-Guideline.rst b/Documentation/source/Outlook/Coding-Guideline.rst deleted file mode 100644 index f3775bc..0000000 --- a/Documentation/source/Outlook/Coding-Guideline.rst +++ /dev/null @@ -1,2 +0,0 @@ -Coding Guideline -================ diff --git a/Documentation/source/Outlook/Fluid/Concepts-of-Models.rst b/Documentation/source/Outlook/Fluid/Concepts-of-Models.rst deleted file mode 100644 index 089c539..0000000 --- a/Documentation/source/Outlook/Fluid/Concepts-of-Models.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fluid - Concepts of Models -========================== diff --git a/Documentation/source/StartNewExtension.rst b/Documentation/source/StartNewExtension.rst index 83a85bc..e35deab 100644 --- a/Documentation/source/StartNewExtension.rst +++ b/Documentation/source/StartNewExtension.rst @@ -1,12 +1,16 @@ Start new extension =================== +We will start with the simplest example ``Hello World``. Once we understood the +basics, we will create an "address" extension to manage a custom record. + Necessary files --------------- -The only necessary file is :file:`ext_emconf.php`. This configures the *Extension -Manager*. Without this file, the Extension Manager would not recognize the extension -and would prevent installation. +Extensions consists of a folder and the single necessary file, which is +:file:`ext_emconf.php`. This configures the *Extension Manager*. Without this file, +the Extension Manager would not recognize the extension and would prevent +installation. .. literalinclude:: ../../CodeExamples/localPackages/example_extension/ext_emconf.php :language: php @@ -15,7 +19,9 @@ See :ref:`t3coreapi:extension-declaration` in TYPO3 Core API Reference. .. admonition:: Task - So let's create a new folder and add the file. + So let's create a new folder and add the file within the folder. + +In this example I'll use :file:`example_extension` as folder name. Install extension ----------------- diff --git a/Documentation/source/index.rst b/Documentation/source/index.rst index 86abafa..dea2589 100644 --- a/Documentation/source/index.rst +++ b/Documentation/source/index.rst @@ -1,7 +1,7 @@ Welcome to TYPO3 Extension Workshop =================================== -This workshop is about the basics of TYPO3 extensions. +This workshop is about the basics of TYPO3 extensions, using Extbase and Fluid. Some "rules" for the workshop ----------------------------- @@ -17,6 +17,8 @@ Some "rules" for the workshop * Ask questions as soon as possible. This way we have the context. +* Tell me if you want less details. + * All materials are available on Github: https://github.com/DanielSiepmann/typo3-extension-workshop * When should we make breaks? Any Smokers here?