承接 neues-studio/hyphen-dictionary 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

neues-studio/hyphen-dictionary

最新稳定版本:1.0.1

Composer 安装命令:

composer require neues-studio/hyphen-dictionary

包简介

Adds server-side hyphen to text using a dictionary.

README 文档

README

1 Motivation

In the past years we have created many TYPO3 websites with mobile versions. Depending on the design, the mobile versions often had headlines with quite a large font size. Using long words leads to either cut of headlines or weird word breaks because of the browsers decision where to break the word. To also support defining optional word breaks (­) for header fields, we have created this extension.

2 What is does

This extension allows editors to define a dictionary of words and optionally word breaks for each of this words.

Using a ViewHelper in fluid templates replaces the given input with in the dictionary defined words.

3 How to use

Install this extension with

composer req neues-studio/hyphen-dictionary

3.1 Creating the dictionary

Create a sys folder in the TYPO3 backend and add words with optional word breaks to it. To set the optional word breaks use [-] at the position the words break should be.

Be aware that the defined words are case-sensitive.

3.2 Using the ViewHelper

To add the optional word breaks to a given string (e.g. headline) use the HyphenateViewHelper.

Example

<html data-namespace-typo3-fluid="true"
      xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
      xmlns:h="http://typo3.org/ns/NeuesStudio/HyphenDictionary/ViewHelpers">
<h:format.hyphenate content="{data.header}" />
or
<h:format.hyphenate>{data.header}</h:format.hyphenate>
or
{data.header -> h:format.hyphenate()}
</html>

You can use the minWordLength argument to define that only words with that length should be hyphenated.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2020-09-30