mia3/typo3-base

此软件包已被废弃,不再维护。未建议替代软件包。

TYPO3 CMS 基础发行版

安装: 23

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 1

分叉: 1

开放问题: 21

语言:HTML

9.5.5 2019-03-04 22:48 UTC

This package is auto-updated.

Last update: 2023-01-06 01:41:51 UTC


README

快速开始使用 TYPO3 CMS。

先决条件

快速入门

  • composer create-project mia3/typo3-base project-name --stability=dev
  • cd project-name
  • git init
  • git add .
  • git commit -a -m "Initial commit"
  • make setup

设置 / 安装

  1. 要开始你的项目,运行以下命令克隆此仓库
    git clone ssh://git@gitlab.mia3.com:2222/mia3/typo3.git
  2. 然后运行以下命令,进入项目文件夹
    cd acme.com
  3. 运行此命令后,你应该可以运行以下命令来安装 TYPO3 和所有必要的依赖项
    make install
  4. 设置本地服务器环境(例如:MAMP)并为此项目创建一个新的数据库。为了避免“应用程序上下文”的错误,使用 local.acme.com 作为此环境的域名。
  5. 现在你可以运行以下命令,设置你的本地数据库连接。
    make setup/env
  6. 输入你的本地数据库信息,然后运行
    make pull-backup
    这将从最后备份下载图像和数据库备份。如果一切设置正确,数据库备份将自动导入到创建的数据库中。
  7. 最后,你应该执行以下命令来捆绑所有 CSS 和 JavaScript 文件。
    make build/watch

目录结构

assets/
├── template/
│   ├── Scripts/
│       ├── Components/
│           ├── Button/
│           ├── Form/
│           ├── MobileMenu/
│       ├── Utility/
│   ├── Styles/
│       ├── Base/
│       ├── ContentElements/
│       ├── Extensions/
│       ├── PageLayout/
│       ├── Utility/
config/
packages/
├── template/
│   ├── Classes/
│       ├── Controller/
│       ├── Domain/
│       ├── Service/
│       ├── TcaUserFunctions/
│       ├── Utility/
│       ├── ViewHelpers/
│   ├── Configuraton/
│       ├── FlexForms/
│       ├── RTE/
│       ├── TCA/
│           ├── Overrides/
│               ├── Mask/
│                   ├── Columns/
│                   ├── Pages/
│                   ├── Types/
│               ├── tt_content/
│       ├── TsConfig/
│       ├── TypoScript/
│   ├── Initialisation/
│   ├── Resources/
│       ├── Private/
│           ├── ExtensionOverrides/
│           ├── Language/
│           ├── Mask/
│           ├── Partials/
│           ├── Templates/
│       ├── Pulblic/
public/
webpack/

目录说明

  • assets/ . 模板扩展的所有资源
    • Scripts/ . 所有 Vue 组件和 JavaScript 文件
    • Styles/ . 所有样式
      • Base/ . 简单和通用样式(字体、表单、按钮等)
      • ContentElements/ . 模板扩展中所有内容元素的样式
      • Extensions/ . 覆盖第三方扩展的样式
      • PageLayout/ . 页面布局组件(如页眉、页脚等)的样式
      • Utility/ . 在许多情况下有用的样式,并且可高度重用
  • config/ . TYPO3 网站配置
  • packages/ . 用于加载此页面自定义扩展的 composer 本地仓库
    • template/ . 此网站的定制模板扩展
      • Classes/
        • Controller/ . 此扩展的控制器
        • Domain/ . 此扩展的领域模型
        • Service/ . 此扩展的服务
        • TcaUserFunctions/ . 支持和扩展 TCA 功能的类
        • Utility/ . 旨在使你的生活更轻松的实用工具类
        • ViewHelpers/ . 适用于各种情况的自定义视图助手
    • Configuration/
      • TCA/Overrides/ . TCA 覆盖
        • Mask/ . 面具元素的 TCA 覆盖
          • Columns/ . 覆盖面具列
          • Pages/ . 通过页面类型/后端布局覆盖 TCA
          • Types/ . 通过类型覆盖面具字段
        • tt_content/ . 覆盖 TYPO3 原生字段
    • Resources/
      • Private/
        • ExtensionOverrides/ . 覆盖第三方扩展的模板文件
        • Language/ . 语言文件
        • Mask/ . 遮罩模板文件(后端 + 前端)
        • Partials/ . 通用部分
        • Templates/ . 通用模板
  • webpack/ . 分割的 webpack 配置文件,可用于将多个构建过程合并为一个

Makefile

使用 Make,我们可以组合多个命令而无需编写 bash 脚本。

现有命令

本地环境

make setup                      # Setup the new project
make build/watch                # Build assets with sourcemaps and watch for changes

make install-dependencies       # Install composer and yarn dependencies
make update-dependencies        # Update composer and yarn dependencies
make setup/database-connection  # Create an AdditionalConfiguration.php
make migrate                    # Apply database migration
make build                      # Build assets with sourcemaps
make build/production           # Build minified assets
make clear-cache                # Clear TYPO3 cache
make pull-backup                # Download latest files and import database dump from operations.mia3.com

预发布环境

make staging/deploy          Deploys to staging from your local machine. Updates database schema and flushes caches.
make staging/clear-cache     Flush staging caches.
make staging/push-backup:    Deploys local database to staging from your machine.

生产环境

make production/deploy # Try not to use this command. Always deploy from GitLab to the production environment.

CSS 和 JavaScript

CSS 和 JavaScript 文件位于 assets 目录。

表单

每个表单都有自己的插件。要添加另一个表单

  1. 创建域模型 -> Classes/Domain/Model/MyFormRequest.php
  2. 注册新插件 -> Configuration/TCA/Overrides/tt_content.php
  3. 配置新插件 -> ext_localconf.php
  4. 创建 flexform -> Configuration/FlexForm/MyForm.xml

待办事项

  • 更新 README.md
    • 在哪里添加 CSS
    • 在哪里添加 JS
  • page.meta.description 空默认值?
  • 如何使用 CSS 变量(postcss-config.js)
  • 网站 URL 配置
    • 开发/本地
    • -> Development/Integration
    • -> Production/Staging
    • -> Production