Mladen
Mladen

Reputation: 139

where to store HTML template files in TYPO3?

I'm learning Typo3 with the official documentation. Now I have achieved the Templating Tutorial:

https://docs.typo3.org/m/typo3/tutorial-templating/9.5/en-us/MinimalDesign/Index.html

There is described to store the HTML file under

page.1.file = fileadmin/sitedesign/Resources/Private/Templates/Minimal.html

So, let's start with the problems I have:

  1. The folder structure (beginning at sitedesign) does not exist.
  2. Under the link https://docs.typo3.org/m/typo3/reference-coreapi/9.5/en-us/ApiOverview/DirectoryStructure/Index.html is told that the fileadmin directory is used for editors and should not be used for HTML templates. This is in contradiction to the official documentation.

Note this directory is meant for editors! Integrators should not locate frontend website layout related files in here: Storing HTML templates, logos, Css and similar files used to build the website layout in here is considered bad practice. Integrators should locate and ship these files within a project specific extension.

  1. So, where should I store HTML template files?

Upvotes: 1

Views: 1545

Answers (3)

Jonas Osburg
Jonas Osburg

Reputation: 1783

Let me add a "raw" answer without a preconfigured sitepackage then.

  1. You need to create a new extension by creating a directory (choose a name yourself, I will call it sitepackage) unter typo3conf/ext
  2. Every extension needs to have an ext_emconf.php file at least (https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ExtensionArchitecture/DeclarationFile/Index.html#extension-declaration) so create one in typo3conf/ext/sitepackage/ext_emconf.php and add needed information (see the link)
  3. Choose where to store your Fluid files. It has become the default to use typo3conf/ext/sitepackage/Resources/Private/Templates, typo3conf/ext/sitepackage/Resources/Private/Layouts, typo3conf/ext/sitepackage/Resources/Private/Partials and create at least a template. Let's call this file typo3conf/ext/sitepackage/Resources/Private/Templates/Minimal.html
  4. Use your approach from above
page.1.file = EXT:sitepackage/Resources/Private/Templates/Minimal.html

Upvotes: 5

Jonas Osburg
Jonas Osburg

Reputation: 1783

The best way is to store your templates in an extension. You can use https://www.sitepackagebuilder.com/ to generate such an extension. This preset already contains HTML files in a location that makes sense (sitepackage/Resources/[Templates/Layouts/Partials]).

Upvotes: 5

TYPO3UA
TYPO3UA

Reputation: 89

Look at this please...

    templateRootPaths {
        [...]
    }
    partialRootPaths {
        [...]
    }
    layoutRootPaths {
        [...]
    }

Upvotes: 1

Related Questions