|
| 1 | +:orphan: |
1 | 2 | .. include:: /Includes.rst.txt |
2 | | -.. highlight:: php |
3 | | - |
4 | | -.. _extension-configuration: |
5 | 3 |
|
6 | 4 | ======================= |
7 | | -Extension Configuration |
| 5 | +Extension configuration |
8 | 6 | ======================= |
9 | 7 |
|
10 | | -.. contents:: |
11 | | - |
12 | | -.. _extension-configuration-composer: |
13 | | - |
14 | | -Composer configuration :file:`composer.json` |
15 | | -============================================ |
16 | | - |
17 | | -In this tutorial we assumed, you |
18 | | -:ref:`installed TYPO3 with Composer <extension-installation>`. |
19 | | -Therefore the extension needs to contain its own :file:`composer.json`. |
20 | | - |
21 | | -.. include:: /CodeSnippets/ExtensionConfiguration/ComposerJson.rst.txt |
22 | | - |
23 | | -For historic reasons TYPO3 extension names are written in |
24 | | -lower case words and separated by underscores if there are more than one. This |
25 | | -is known as the extension key. The directory containing the extension should have |
26 | | -the same name as the extension key. Composer package names are written in |
27 | | -lower-case words but are by convention separated with dashes if there |
28 | | -is more than one word. |
29 | | - |
30 | | -At the top of the :file:`composer.json` file we see the Composer package name |
31 | | -`t3docs/site-package` (with a dash) and at the bottom we see the TYPO3 |
32 | | -extension key in the extra section - :file:`site_package` (with an underscore). |
33 | | -The Composer "name" consists of a vendor name followed by a forward slash and the |
34 | | -lowercase extension name with dashes. |
35 | | - |
36 | | -.. hint:: |
37 | | - Make sure you don't mix up your underscores and dashes otherwise Composer |
38 | | - will not find your site-package extension. |
39 | | - |
40 | | -.. _extension-icon: |
41 | | - |
42 | | -Extension icon |
43 | | -============== |
44 | | - |
45 | | -Every extension can feature an icon using an SVG, PNG or GIF file. |
46 | | -The image should be stored in :file:`Resources/Public/Icons/`. |
47 | | - |
48 | | -It is recommended that you use an SVG file called :file:`Extension.svg`. The |
49 | | -icon is displayed in the extension manager |
50 | | -(:ref:`see Public directory <t3coreapi:extension-Resources-Public>`). |
51 | | - |
52 | | -.. _make-typoscript-available: |
53 | | -.. _site_set: |
54 | | - |
55 | | -Set for providing TypoScript |
56 | | -============================ |
57 | | - |
58 | | -.. versionchanged:: 13.1 |
59 | | - In TYPO3 v13.1 and above the TypoScript files are made available as |
60 | | - sets and included in the site. For TYPO3 v12 read the section in |
61 | | - the tutorial for TYPO3 v12.4: |
62 | | - :ref:`Make TypoScript available (TYPO3 v12.4) <t3sitepackage-12:make-typoscript-available>`. |
63 | | - |
64 | | -In order to make the TypoScript files available, we have created in section |
65 | | -:ref:`TypoScript configuration <t3sitepackage:typoscript-configuration>` we |
66 | | -create a site set that can be included by the site configuration later-on. |
67 | | - |
68 | | -Create a folder: :path:`Configuration/Sets/MySitePackage/` and put a file |
69 | | -called :file:`config.yaml` into it: |
70 | | - |
71 | | -.. include:: /CodeSnippets/ExtensionConfiguration/SitePackage-config.rst.txt |
72 | | - |
73 | | -Line 1 defines the name of the set. As the example site-package extension only |
74 | | -provides one set, the name of the set should be the same as the |
75 | | -:ref:`composer name <extension-configuration-composer>`. |
76 | | - |
77 | | -In line 4 and 5 dependencies are defined. In this example the site package |
78 | | -depends on :composer:`typo3/cms-fluid-styled-content`, therefore the sets provided by this |
79 | | -system extension are included as dependency. By doing so all settings |
80 | | -and TypoScript definitions provided by the extension are automatically included. |
81 | | - |
82 | | -In the same folder we can place a file called :file:`settings.yaml` that we use |
83 | | -to override some default settings of :composer:`typo3/cms-fluid-styled-content`: |
84 | | - |
85 | | -.. include:: /CodeSnippets/ExtensionConfiguration/SitePackage-settings.rst.txt |
86 | | - |
87 | | -Here we override some values for maximal image width in text-media content |
88 | | -elements, we enable a lightbox for images and set paths for overriding the |
89 | | -templates of that extension. |
90 | | - |
91 | | -Then we put a file called :file:`setup.typoscript` into this folder. We use |
92 | | -this file to include all TypoScript needed from the folder |
93 | | -:path:`Configuration/TypoScript`. It would also be possible to place the |
94 | | -TypoScript directly into this file. But we want to split our TypoScript into |
95 | | -different files. |
96 | | - |
97 | | -.. include:: /CodeSnippets/ExtensionConfiguration/SitePackage-setup.rst.txt |
98 | | - |
99 | | -As we only have a few lines of TypoScript constants we define them directly in |
100 | | -a file called :file:`constants.typoscript` in this folder: |
101 | | - |
102 | | - |
103 | | - |
104 | | -Last we add a file called :file:`page.tsconfig` which includes the backend page |
105 | | -layouts we create in :ref:`backend-page-layouts`: |
106 | | - |
107 | | -.. include:: /CodeSnippets/ExtensionConfiguration/SitePackage-page-tsconfig.rst.txt |
108 | | - |
109 | | -.. _ec-directory-structure: |
110 | | - |
111 | | -Directory and file structure |
112 | | -============================ |
113 | | - |
114 | | -Let's review the directory and file structure of the sitepackage extension as |
115 | | -it stands now. |
116 | | - |
117 | | -.. todo: replace TwoColumns with Subpage (tsconfig, html, svg) |
118 | | -.. todo: replace files in TypoScript/Setup |
119 | | -
|
120 | | -.. directory-tree:: |
121 | | - :level: 2 |
122 | | - :show-file-icons: true |
123 | | - |
124 | | - * site_package |
125 | | - |
126 | | - * Configuration |
127 | | - |
128 | | - * Sets |
129 | | - |
130 | | - * SitePackage |
131 | | - |
132 | | - * config.yaml |
133 | | - * page.tsconfig |
134 | | - * settings.definitions.yaml |
135 | | - * settings.yaml |
136 | | - * setup.typoscript |
137 | | - |
138 | | - * TsConfig |
139 | | - |
140 | | - * Page |
141 | | - |
142 | | - * PageLayout |
143 | | - |
144 | | - * Default.tsconfig |
145 | | - * TwoColumns.tsconfig |
146 | | - |
147 | | - * TypoScript |
148 | | - |
149 | | - * Setup |
150 | | - |
151 | | - * Page.typoscript |
152 | | - * Part1PageViewSection.typoscript |
153 | | - * Part2CssFileInclusion.typoscript |
154 | | - * Part4GlobalConfiguration.typoscript |
155 | | - .. * Part5MenuProcessor.typoscript |
156 | | - .. * Part6ProcessedContent.typoscript |
157 | | -
|
158 | | - * Resources |
159 | | - |
160 | | - * Private |
161 | | - |
162 | | - * Layouts |
163 | | - |
164 | | - * Default.html |
165 | | - |
166 | | - * Partials |
167 | | - |
168 | | - * Jumbotron.html |
169 | | - |
170 | | - * Templates |
171 | | - |
172 | | - * Pages |
173 | | - |
174 | | - * Default.html |
175 | | - * TwoColumns.html |
176 | | - |
177 | | - * Public |
178 | | - |
179 | | - * Css |
180 | | - |
181 | | - * website.css |
182 | | - |
183 | | - * Icons |
184 | | - |
185 | | - * BackendLayouts |
186 | | - |
187 | | - * default.svg |
188 | | - * twoColumns.svg |
189 | | - |
190 | | - * Extension.svg |
191 | | - |
192 | | - * Images |
193 | | - |
194 | | - * logo.svg |
195 | | - |
196 | | - * JavaScript |
197 | | - |
198 | | - * website.js |
199 | | - |
200 | | - * composer.json |
201 | | - |
202 | | -At this point we can install the sitepackage extension in an TYPO3 instance, |
203 | | -which we will do in the next step. |
| 8 | +Content was moved, see :ref:`Composer configuration composer.json <t3sitepackage:extension-configuration-composer>`, |
| 9 | +:ref:`Site sets: Further configuration options <t3sitepackage:site-sets-configuration>`. |
0 commit comments