定制 contao-themes-net/bootstrap-icons-inserttag 二次开发

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

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

contao-themes-net/bootstrap-icons-inserttag

Composer 安装命令:

composer require contao-themes-net/bootstrap-icons-inserttag

包简介

Bootstrap Icons Inserttag Bundle for Contao 4

README 文档

README

Dieses Bundle installiert ein InserTag, mit dessen Hilfe Bootstrap Icons (v1.9.1) als Font oder via SVG in Contao genutzt werden können.

Allgemeine Form des Tags

Das Tag beginnt mit dem Prefix  bi  und ihm folgen drei weitere Parameter. Parameter 1 und 2 sind erforderlich, Parameter 3 und 4 sind optional und können auch weggelassen werden. Das Tag besteht also insgesamt aus 4 Parametern. Die allgemeine Form sieht so aus:

{{bi::name::classes::styles}}

Der erste Parameter »bi«

...ist konstant und kennzeichnet das Tag.

Der zweite Parameter »name«

...muss durch den Namen des Icons ersetzt werden. Dabei sollte der Name des Icons verwendet werden, wie er auf der Seite Bootstrap Icons angegeben ist: https://icons.getbootstrap.com - also ohne Prefix bi-!

Beispiel:

{{bi::check}}

Als Ergebnis sollte dieses Zeichen zu sehen sein: check.svg

Der dritte Parameter »classes«

...kann (ist optional) eine oder mehrere CSS-Klassen-Namen enthalten. Für das Bereitstellen der Klasse müssen die Administratorinnen und Administratoren selbst Sorge tragen. Mehrere Klassen-Namen können wie im class-Attribute eines HTML-Tags notiert werden - also auch durch Leerzeichen getrennt.

Beispiel:

{{bi::check::class1 class2 class3}}

Das Ergebnis könnte - je nach Definition der Klassen - so aussehen:

check

Der vierte Parameter »styles«

...kann (ist optional) eine oder mehrere Style-Anweisungen enthalten.

Beispiel:

// für svg
{{bi::badge-3d-fill::class1 class2::width:50px;background-color:orangered;border-radius: 50px;}}

// für icon font
{{bi::badge-4k-fill::class1 class2::font-size:3em;background-color:orangered;border-radius: 50px;}}

Das Ergebnis sollte so aussehen:

badge-3d

badge-4k

Achtung! Die Vordergrundfarbe (color) kann für ein SVG-Element nicht durch das style-Attribute gesetzt werden!

Konfiguration

Das Bootstrap Icons InsertTag Bundle kann in geringem Umfang mit der parameters.yml konfiguriert werden. Diese wird wie folgt mitgeliefert:

parameters:
    bootstrap_config:
        source:
            use_cdn: false
            css_source: 'https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css'
            js_source:  'https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.bundle.min.js'
        use:
            icon_font: false
            svg: true

Die Konfiguration befindet sich unterhalb des Schlüssels bootstrap_config.

Zurzeit werden dort zwei weitere Schlüssel ausgewertet. Der Schlüssel source und der Schlüssel use.

source

Da mit dem Bundle eine Fallback-Konfiguration mitgeliefert (Script, Fonts, SVG und CSS von Bootstrap Icons 1.9.1) wird, kann hier mit dem Schlüssel use_cdn: true das Laden vom CDN aktiviert oder deaktiviert werden. Ist use_cdn auf false gesetzt, dann werden die lokalen Bundle-Assets verwendet, damit das Bundle bei Versionsänderungen im CDN lauffähig bleibt.

Wenn use_cdn aktiviert ist, können die Quellen mittels css_source und js_source definiert werden. Voreingestellt sind o.g. Quellen.

use

Mit dem Schlüssel use können die beiden Darstellungsmethoden der Icons festgelegt werden. Fallback ist icon_font: true. Beide Schlüssel können auf true gesetzt sein. Es können aber (in der aktuellen Version) nicht beide Darstellungsmethoden zugleich verwendet werden! Soll statt Icon Font die Methode SVG zum Einsatz kommen, so muss icon_font: false und svg: true gesetzt sein. Andernfalls tritt immer der Fallback icon_font: true ein.

Bootstrap Icons Inserttag Bundle

This bundle installs an InserTag that allows Bootstrap Icons (v1.9.1) to be used as a font or via SVG in Contao.

General form of the tag

The tag starts with the prefix  bi  and it is followed by three more parameters. Parameters 1 and 2 are required, parameters 3 and 4 are optional and can be omitted. So the tag consists of a total of 4 parameters. The general form looks like this:

{{bi::name::classes::styles}}

The first parameter »bi«

...is constant and identifies the tag.

The second parameter »name«

...must be replaced by the name of the icon. The name of the icon should be used as shown on the Bootstrap Icons page: https://icons.getbootstrap.com - that is, without the bi- prefix!

Example:

{{bi::check}}

As a result you should see this character: check.svg

The third parameter »classes«

...may (is optional) contain one or more CSS class names. The administrators must take care of providing the class themselves. Multiple class names can be noted as in the class attribute of an HTML tag - i.e. also separated by spaces.

Example:

{{bi::check::class1 class2 class3}}

The result could - depending on the definition of the classes - look like this:

check

The fourth parameter »styles«

...may (is optional) contain one or more style statements.

Beispiel:

// for svg
{{bi::badge-3d-fill::class1 class2::width:50px;background-color:orangered;border-radius: 50px;}}

// for icon font
{{bi::badge-4k-fill::class1 class2::font-size:3em;background-color:orangered;border-radius: 50px;}}

The result could - depending on the definition of the classes - look like this:

badge-3d

badge-4k

Attention! The foreground color (color) cannot be set for an SVG element by the style attribute!

Configuration

The Bootstrap Icons InsertTag Bundle can be configured to a small extent using parameters.yml. This is supplied as follows:

parameters:
    bootstrap_config:
        source:
            use_cdn: false
            css_source: 'https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css'
            js_source: 'https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.bundle.min.js'
        use:
            icon_font: false
            svg: true

The configuration is located below the bootstrap_config key.

Currently, two other keys are evaluated there. The source key and the use key.

source

Since a fallback configuration is provided with the bundle (scirpt, fonts, SVG and CSS from Bootstrap Icons 1.9.1), the key use_cdn: true can be used to enable or disable loading from the CDN. If use_cdn is set to false, the local bundle assets are used so that the bundle is executable in case of version changes in the CDN.

If use_cdn is enabled, the sources can be defined with css_source and js_source. The default sources are those listed above.

use

The use key can be used to define the two display methods of the icons. Fallback is icon_font: true. Both keys can be set to true. **However (in the current version) both display methods cannot be used at the same time! If the SVG method is to be used instead of Icon Font, icon_font: false and svg: true must be set. Otherwise the fallback icon_font: true will always occur.

contao-themes-net/bootstrap-icons-inserttag 适用场景与选型建议

contao-themes-net/bootstrap-icons-inserttag 是一款 基于 HTML 开发的 Composer 扩展包,目前已累计 54 次下载、GitHub Stars 达 1, 最近一次更新时间为 2022 年 06 月 03 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 contao-themes-net/bootstrap-icons-inserttag 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 contao-themes-net/bootstrap-icons-inserttag 我们能提供哪些服务?
定制开发 / 二次开发

基于 contao-themes-net/bootstrap-icons-inserttag 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • 开发语言: HTML

其他信息

  • 授权协议: LGPL-3.0-or-later
  • 更新时间: 2022-06-03