Sitepackage for TYPO3 CMS that adheres to the recommended standards, maps all conceivable functional areas and contains examples for common use cases.

Overview

TYPO3 CMS Sitepackage TYPO3 CMS Sitepackage

This sitepackage sticks as closely as possible to the recommended standard and maps all conceivable functional areas. There are also various examples of common use cases.

For more details there is a documentation link in the comments of each file.

Features

Full blown directory and file structure

This sitepackage contains almost all the directories and files (except resource files) you need when creating your own sitepackage.

Color scheme selector

As an example of how to add new fields to pages records through ext_tables.sql and /Configuration/TCA/Overrides/pages.php and how to implement custom Symfony Conditions (with files Configuration/ExpressionLanguage.php, Classes/ExpressionLanguage/CustomTypoScriptConditionProvider.php and Classes/ExpressionLanguage/FunctionsProvider/CustomConditionFunctionsProvider.php) to be used in the TypoScript/TSconfig context (Configuration/TypoScript/Setup/page.typoscript) this sitepackage contains a method to provide choosable color schemes to backend users.

Backend Style Customization

This sitepackage can customize the TYPO3 login mask style (background image, footnote, highlight color, login logo and login logos alt text) and the backend style (backend favicon and logo). It uses the function of EXT:backend. But instead of relying on a backend user to set these variables through the extension settings it overrides them in ext_localconf.php with the Extension Configuration of this sitepackage in ext_conf_template.txt (which is an easier and centralized way).

Example Backend Layouts

Example BackendLayouts can be found here Configuration/TsConfig/Page/Default/mod.web_layout.BackendLayouts/ (as part of the always loaded default Page TSconfig) and here Configuration/TsConfig/Page/Include/mod.web_layout.BackendLayouts (as part of the user included Page TSconfig).

Example Custom Content Element

This sitepackage includes an example of a custom content element. Its icon has been defined in Configuration/Icons.php, it is registered and configured in Configuration/TCA/Overrides/tt_content.php and added to the newContentElement wizard in Configuration/TsConfig/Page/Include/mod.wizards.newContentElement.wizardItems/common.tsconfig. The frontend rendering based on EXT:fluid_styled_content is configured in Configuration/TypoScript/Setup/tt_content/sitepackage_newcontentelement.typoscript and finally rendered by Fluid template Resources/Private/Templates/Page/Example.html.

Custom ViewHelper

As an example of how to add custom ViewHelpers this sitepackage adds the possibility to modify attributes of the html tag by the HtmlTagAttributesViewHelper in file Classes/ViewHelpers/HtmlTagAttributesViewHelper.php. The ViewHelper namespace xmlns:s="http://typo3.org/ns/VendorName/Sitepackage/ViewHelpers" has been added to the Fluid Template file Resources/Private/Layouts/Page/Default.html and it is used to add information about the currently selected layout as data attribute with tag <s:htmlTagAttributes data="{data-layout:current}"/>.

Custom Symfony Command

If you want to run any process from your sitepackage using the command line interface (CLI) such as a time-consuming import of data from an external system, symfony commands are the way to go. A simple example is shown in this sitepackage under Classes/Command/DoSomethingCommand.php. Command Classes like this are registered under Configuration/Services.yaml.

To run the example command enter the following line:

Composer-based installation:

vendor/bin/typo3 sitepackage:dosomething anyArgument -o anyOptionValue

Legacy installation:

typo3/sysext/core/bin/typo3 sitepackage:dosomething anyArgument -o anyOptionValue

XML Sitemap configuration

When EXT:seo is loaded, its static TypoScript is automatically included. The sitepackage adds the ability to hide pages in the XML sitemap by setting the sitemap priority to 0 with the constant Configuration/TypoScript/Constants/plugin/tx_seo.typoscript. Please make sure to add the following lines to your site configuration to be able to access the sitemap via its human-readable URI sitemap.xml if you have not used this sitepackage as a distribution:

routeEnhancers:
  PageTypeSuffix:
    type: PageType
    map:
      sitemap.xml: 1533906435

Cross Browser Favicons

Based on resources of RealFaviconGenerator v0.16 the sitepackage includes all recommended cross browser definitions for Favicons / App Icons. The sitepackage adds all html header information in file Configuration/TypoScript/Setup/page.typoscript.

The file Configuration/TypoScript/Setup/browserconfig.typoscript configures a separete PAGE object with mime type text/xml to output the browserconfig.xml.

The file Configuration/TypoScript/Setup/site.webmanifest.typoscript configures a separete PAGE object with mime type application/json to output the site.webmanifest.

To be able to also display browserconfig.xml and site.webmanifest you need to add the following lines in your site configuration if you have not used this sitepackage as a distribution:

routeEnhancers:
  PageTypeSuffix:
    type: PageType
    map:
      # The above-mentioned configuration for "sitemap.xml" may already be here. 
      browserconfig.xml: 2943879438
      site.webmanifest: 3478304621

Note: Since all resources are referenced with paths generated by TYPO3, this solution is compatible with the future changeover by typo3/cms-composer-installers:4.0. Here you can get further information about the changes.

Site Configuration Auto Initialization

If you install this sitepackage in an empty TYPO3 CMS installation it will create a new site configuration with configuration for sitemap.xml, browserconfig.xml and site.webmanifest, a first root page with a link to the static TSconfig of this sitepackage, a template record with a link to the static TypoScript of this sitepackage and pages records for various HTTP error codes (404, 403, 500, 503 and undefined), which are referenced in the site configuration.

By default the language en-US is used. If you want to change it, just edit the site configuration in your TYPO3 installation under config/sites/sitepackage/config.yamlor via the Site Management > Sites module in the TYPO3 backend.

Ready to use Task Runner for SCSS and JavaScript

This site package provides a Gulp task runner that handles the following tasks:

  • Compile SCSS from Resources/Public/Scss/ to CSS directory Resources/Public/Css/
  • Improve backwards compatibility of your CSS code by using the well known Autoprefixer PostCSS plugin
  • Minify JavaScript and CSS files and save them as separate files with ending *.min.css / *.min.js
  • Static JavaScript code analysis with (JSHint Documentation), feel free to adjust the configuration file .jshintrc to your needs
  • Concatenate and minify all JavaScript files from directory Resources/Public/JavaScript/Src and save the result under Resources/Public/JavaScript/Dist

To initially install Gulp and all necessary modules execute command npm install. Now you are able to run all tasks at once by executing command gulp. To run specific tasks use gulp <taskname>. To get an overview wich tasks can be executed run gulp --tasks.

Basic Structure

FAQ:

How to get rid of the README.md files?

If you get disturbed by the README.md files in your current project, run the following command inside the sitepackage root to delete them:

find ./packages/sitepackage/ -name "README.md" -type f -delete

or in DDEV:

ddev exec find ./packages/sitepackage/ -name "README.md" -type f -delete

How do I easily change the namespace, composer name and extension key?

If you want to change the Namespace used in all files from VendorName/Sitepackage to FancyCompany/GreatExtension (adjust this example to your needs) use the following commands:

find ./packages/sitepackage \( -iname \*.html \) -type f -print0 | xargs -0 sed -i 's/VendorName\/Sitepackage/FancyCompany\/GreatExtension/g'
find ./packages/sitepackage \( -iname \*.php -o -iname \*.yaml \) -type f -print0 | xargs -0 sed -i 's/VendorName\\\Sitepackage/FancyCompany\\\GreatExtension/g'
find ./packages/sitepackage \( -iname \*.php -o -iname \*.json \) -type f -print0 | xargs -0 sed -i 's/VendorName\\\\\\\Sitepackage/FancyCompany\\\\\\\GreatExtension/g'

To change the composer name and extension key use the following commands:

find ./packages/sitepackage \( -iname \*.json \) -type f -print0 | xargs -0 sed -i 's/vendorname\/sitepackage/fancy-company\/great-extension/g'
find ./packages/sitepackage \( -iname \*.php -o -iname \*.xml -o -iname \*.yaml -o -iname \*.typoscript -o -iname \*.tsconfig -o -iname \*.xlf -o -iname \*.json \) -type f -print0 | xargs -0 sed -i 's/sitepackage/great-extension/g'
mv ./packages/sitepackage ./packages/great-extension

or in DDEV:

ddev exec "find ./packages/sitepackage \( -iname \*.html \) -type f -print0 | xargs -0 sed -i 's/VendorName\/Sitepackage/FancyCompany\/GreatExtension/g'"
ddev exec "find ./packages/sitepackage \( -iname \*.php -o -iname \*.yaml \) -type f -print0 | xargs -0 sed -i 's/VendorName\\\Sitepackage/FancyCompany\\\GreatExtension/g'"
ddev exec "find ./packages/sitepackage \( -iname \*.php -o -iname \*.json \) -type f -print0 | xargs -0 sed -i 's/VendorName\\\\\\\Sitepackage/FancyCompany\\\\\\\GreatExtension/g'"
ddev exec "find ./packages/sitepackage \( -iname \*.json \) -type f -print0 | xargs -0 sed -i 's/vendorname\/sitepackage/fancy-company\/great-extension/g'"
ddev exec "find ./packages/sitepackage \( -iname \*.php -o -iname \*.xml -o -iname \*.yaml -o -iname \*.typoscript -o -iname \*.tsconfig -o -iname \*.xlf -o -iname \*.json \) -type f -print0 | xargs -0 sed -i 's/sitepackage/great-extension/g'"
ddev exec mv ./packages/sitepackage ./packages/great-extension

© 2022 Eric Bode

You might also like...
Maps Railroad Online Savegames to a SVG map

RailroadOnlineMapper @ian76g#6577 Environments DEV - https://zwackelmann.online/ QA - https://ohnezahn.online/ PROD - https://minizwerg.online/ Gettin

Simple library that abstracts different metrics collectors. I find this necessary to have a consistent and simple metrics (functional) API that doesn't cause vendor lock-in.

Metrics Simple library that abstracts different metrics collectors. I find this necessary to have a consistent and simple metrics API that doesn't cau

A collection of type-safe functional data structures

lamphpda A collection of type-safe functional data structures Aim The aim of this library is to provide a collection of functional data structures in

A simple functional programming library for PHP
A simple functional programming library for PHP

bingo-functional A simple functional programming library for PHP. Requirement(s) PHP 7 or higher Rationale PHP, a language not commonly associated wit

Small library providing some functional programming tools for PHP, based on Rambda

Functional library for PHP. Features: set of useful functions helpful in functional programming all functions are automatically curried every array ca

N2Web turns your Notion HTML export into a fully functional static website
N2Web turns your Notion HTML export into a fully functional static website

Notion2Web N2Web turns your Notion HTML export into a fully functional static website. What is Notion? Notion is an online tool. But I can't tell you

Simple libary for functional programing paradigm with arrays.
Simple libary for functional programing paradigm with arrays.

rodrigodornelles/php-array-lib simple libary for functional programing paradigm with arrays Features Test driven development style (TDD) PHP version c

WARNING! This software is currently non-functional. - A system which makes installing Jexactyl far, far easier.
WARNING! This software is currently non-functional. - A system which makes installing Jexactyl far, far easier.

Jexactyl Assistant A system which makes installing Jexactyl far, far easier. WARNING 🚧 This software is currently in heavy alpha testing and WILL NOT

PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.

PHP_CodeSniffer is a set of two PHP scripts; the main phpcs script that tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding standard, and a second phpcbf script to automatically correct coding standard violations. PHP_CodeSniffer is an essential development tool that ensures your code remains clean and consistent.

Owner
Eric Bode
TYPO3 CMS Certified Integrator (TCCI) TYPO3 Association Bronze Member
Eric Bode
WPForms coding standards are based on the WordPress Coding Standards and the PHPCompatibility Coding Standards and help create strict and high-quality code.

WPForms coding standards are based on the WordPress Coding Standards and the PHPCompatibility Coding Standards and help create strict and high-quality code.

Awesome Motive, Inc. 7 Nov 29, 2022
TYPO3 CMS extension which extends TYPO3 page cache, by tags based on entities used in fluid templates.

Fluid Page Cache for TYPO3 CMS This TYPO3 CMS extension allows you to clear frontend page caches, automatically when a displayed record has been updat

Armin Vieweg 1 Apr 8, 2022
Examples of some common design patterns implemented in php

What is a Design Pattern? Design patterns are typical solutions to common problems in software design. Each pattern is like a blueprint that you can c

Bakhtiyor Bahritidinov 4 Feb 11, 2022
Food theme for Commerce, intended for food delivery/pickup use cases

Food theme for Commerce ################################ WORK IN PROGRESS - NOT READY FOR USE ################################ This theme for Commerce

modmore | More for MODX 5 Feb 15, 2022
With the phpBB extension "Hide for Guest" you can hidden selected areas for guests and bots.

phpBB-Hide for Guest Description With "Hide for guest" selected areas are hidden for guests and bots. Requirements php 7.3 or higher phpBB 3.2.0 or hi

Thorsten 2 Dec 15, 2022
Methods to allow the mapping of cases to snake / camel for input / output

Methods to allow the mapping of cases to snake / camel for input / output This is where your description should go. Limit it to a paragraph or two. Co

Craig Smith 4 Aug 31, 2022
TYPO3 Extension for on-the-fly evaluation hints in FormEngine

OTF - A TYPO3 extension to display on-the-fly evaluation hints in FormEngine This TYPO3 extension allows to add a FormEngine FieldWizard to specific T

b13 GmbH 3 Sep 22, 2022
GDPR compliant TYPO3 content elements which work great with PIWIK Consent Manager.

PIWIK Consent Manager TYPO3 extension PIWIK Consent Manager integration in order to make TYPO3 content elements GDPR compliant. You can click on the i

null 6 Aug 8, 2022
Utilities to scan PHP code and generate class maps.

composer/class-map-generator Utilities to generate class maps and scan PHP code. Installation Install the latest version with: $ composer require comp

Composer 55 Dec 26, 2022