定制 thelia/frontoffice-modern-template 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

thelia/frontoffice-modern-template

最新稳定版本:2.6.0

Composer 安装命令:

composer require thelia/frontoffice-modern-template

包简介

README 文档

README

⚠ This is the repository of Thelia default frontoffice template. All the pull requests on this repo will be ignored. If you want to create a project, please take a look at thelia/thelia-project If you want to contribute to Thelia, please take a look at thelia/thelia

About

This Thelia template is based on Symfony Encore, it uses Smarty (Thelia default templating engine) for static content and React for managing dynamic components (eg:cart). Styling is done with Tailwind and PostCSS, but can be overrided or switched, to use any other css preprocessor/ css framework.

Prerequisites

Available commands

$ yarn build

(compile & optimize assets for production)

$ yarn start

(development mode with live-reload)

Manual Installation

$ yarn install && yarn build

Components

This template is based around pages templates (located at the root of this directory) and a components system (in the components directory).

Components system

  • Component should be reusable and the more agnostic possible to allow them to be composed freely.
  • Files relative to the component (html, css, js, images, ...) should all be inside the component directory to keep them organized and easy to move around.

Retrieving compiled assets in pages

Symfony Encore use entries to identify the different JS bundles composing the template, those entries can be modified in the webpack.config.js file. This pattern allow your js code to be split and used only on the relevant pages.

You declare them like:

Encore.addEntry('app', './assets/js/app.js')
	.addEntry('home', './assets/js/routes/home')
	.addEntry('category', './assets/js/routes/category')
	.addEntry('product', './assets/js/routes/product')
	.addEntry('register', './assets/js/routes/register')
	.addEntry('address', './assets/js/routes/address')
	.addEntry('delivery', './assets/js/routes/delivery');

and you use them like:

⚠️ layout.tpl ⚠️ (this is the main JS bundle, which is used for every pages of the website)

    {block name="css"}
      {encore_entry_link_tags entry="app"}
    {/block}
    {block name="javascript"}
      {encore_entry_script_tags entry="app"}
    {/block}

product.html (note the use of the append keyword in the smarty block, allowing us to keep the main bundle instead of replacing it)

{block name="css" append}
  {encore_entry_link_tags entry="product"}
{/block}

{block name="javascript" append}
  {encore_entry_script_tags entry="product"}
{/block}

Image & other assets

You can use the smarty function {encore_manifest_file file="key/of/your/asset/in/the/manifest"} to retrieve any assets compiled by Symfony Encore, the manifest.json file can be found inside the dist directory

  <link rel="icon" type="image/png" sizes="32x32" href="{encore_manifest_file file="dist/favicons/favicon-32x32.png"}">

Documentations

Useful extensions for developping with VS Code

统计信息

  • 总下载量: 6.44k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 4
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2021-02-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固