buepro/typo3-user-pizpalue

TYPO3 Custom template being used with template pizpalue.

Installs: 58

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 0

Forks: 1

Open Issues: 0

Type:typo3-cms-extension

dev-master 2021-04-01 18:02 UTC

This package is auto-updated.

Last update: 2021-05-01 18:11:44 UTC


README

Extension pizpalue Extension pizpalue_distribution

This extension serves as a base to customize a TYPO3-website using the template pizpalue.

Composer

To use the extension in a composer environment different approaches are available. Following two ways are further outlined:

Without version control

  1. Don't add buepro/typor-user-pizpalue as a requirement to the composer configuration
  2. Copy the extension manually to the extension directory (typo3conf/ext/user_pizpalue)
  3. Add the following autoload declaration to the composer configuration from the web site:
    "autoload": {
         "psr-4": {
             "Buepro\\UserPizpalue\\": "public/typo3conf/ext/user_pizpalue/Classes/"
         }
     }
    
  4. Run composer dumpautoload to generate the autoload info

With version control

  1. Add your repository to the composer configuration from the web site:
    "repositories": [
        {
             "type": "vcs",
             "url": "https://user@domain.ch/path_to_git/typo3-user-pizpalue.git"
        }
    ],
    
  2. Update the require section from the composer configuration from the web site:
    "require": {
        "buepro/typo3-user-pizpalue": "dev-mybranch",
    }
    
  3. Run composer update

Usage

When starting a new project create a new git-branch and just commit to that branch. The master branch should always be used to start new projects.

To increase quality work progress might be committed and documented. Documentation has its home in the folder Documentation. A changelog can be created with the following steps:

  1. In a shell go to the Build directory
  2. Run npm install (only needed, if not already done)
  3. Run grunt doc

Customizations

TypoScript (TS)

Customizations typically start by adapting the ts constants and ts setup. Frequently used configurations are collected in the folder Configuration/TypoScript/Default. You might use them to get started by copying the needed fragments to Configuration/TypoScript/constants.typoscript or Configuration/TypoScript/setup.typoscript. The inclusion from the default TS (see @import...) might be deleted.

CSS/SCSS

Style declarations are maintained in the folder Resources/Public/Scss. For stylesheets to be embedded TS needs to be setup. See page.includeCSS for further details.

Icon font

It might become handy to create a customized icon font. Ideally it contains all used icons from the website. To generate an icon font the icons need to be available in svg-format. Unfortunately not all svg-formats lead to the desired result hence some testing might be needed. An icon font might be created by following these steps:

  1. Copy all svg-icons to the folder Resources/Public/Icons/Font
  2. In a shell go to the Build directory
  3. Run npm install (only needed, if not already done)
  4. Run grunt iconfont

Upon creating the icon font its resources can be found in Resources/Public/Fonts. Next the font needs to be embedded with the following TS setup:

page {
    includeCSSLibs {
        pizpalueicon >
        upicon = EXT:user_pizpalue/Resources/Public/Fonts/upicon.min.css
        upicon {
            fontLoader {
                families {
                    0 = UpIcon
                }
                enabled = 1
            }
        }
    }
}

Now your ready to use the icon font in the markup: <i class="upicon upicon-custom1"></i> would render an icon showing the graphic defined by custom1.svg.

Layouts/Templates/Partials

They are maintained in Resources/Private. As an example to add a new page template follow these steps:

  1. Create the template in the directory Resources/Private/Templates/Page
  2. Enable the template in the TS constant declaration
user_pizpalue {
    page.fluidtemplate {
        templateRootPath = EXT:user_pizpalue/Resources/Private/Templates/Page/
    }
}

Development

For smaller projects the following workflow might be of interest:

Setup development environment

  1. Adjust the header comment in .php_cs.php
  2. Create a ddev container: ddev start
  3. Enter the container: docker exec -it -u root -w /var/www/html ddev-up-web bash
  4. Set environment variable: export COMPOSER=composer-dev.json && printenv | grep COMPOSER=
  5. Install composer packages: composer install

Work in development environment

  1. Optional, check the code: composer check:php
  2. Correct the code: composer fix:php

Remove development environment

  1. Uninstall composer packages: composer uninstall
  2. Unset the environment variable: unset COMPOSER | grep COMPOSER=
  3. Leave the container: exit
  4. Stop the container: ddev stop

Available linters

  • TyposScript: composer lint:ts
  • Yml and yaml: composer lint:yaml
  • Json: composer lint:json

Coding guidelines

  • Use the coding guidelines defined by TYPO3 .
  • Use up, Up, up-, upc- as package related prefixes where upc- is mainly used for complementary css classes used together with other selectors (e.g. .up-example .upc-red { ... })

Frequently used

For coding

For documentation