定制 spicyweb/craft-odds-and-ends 二次开发

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

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

spicyweb/craft-odds-and-ends

最新稳定版本:5.1.0

Composer 安装命令:

composer require spicyweb/craft-odds-and-ends

包简介

A collection of useful tools for Craft CMS websites

README 文档

README

Odds & Ends

A collection of useful tools for Craft CMS websites.

Field types

Width

This lets you define the width of a block as well as left and right padding. This field simply outputs three sets of classes which can be defined when setting the field up.

Width Field Settings Width Field

Author Instructions

This lets you output markdown instead of a field, which is useful when you have a Matrix block that doesn’t have any fields.

Author Instructions Example

Categories (multiple groups)

A Categories input that lets you select multiple Category groups.

Ancestors

An Entries input that only shows the ancestors of the current Entry.

Disabled Fields

The same as regular fields, but disabled. Useful for situations where you want to integrate with a third party API and store that information in a field but don’t want the user to change it.

The following field types are currently supported:

  • Entries
  • Categories
  • Lightswitch
  • Number
  • PlainText
  • Dropdown
  • Commerce Products
  • Commerce Variants

Widgets

Roll Your Own

A simple widget that lets you assign a template to load from your site templates folder. Go nuts.

Miscellaneous

Download File

A controller action that will download an asset file.

The id parameter is required and must be a valid asset ID.

Usage:

<a href="{{ actionUrl('tools/tools/download-file', { id: entry.assetField.one().id }) }}">Download</a>

Configuration

By default, all normal field types and widgets are enabled. The commerce field types are only enabled if Craft Commerce is installed and enabled. You can disable each field type and widget by adding the following to your project's config/tools.php file:

use spicyweb\oddsandends\fields\AuthorInstructions;
use spicyweb\oddsandends\fields\DisabledProducts;
use spicyweb\oddsandends\widgets\RollYourOwn;

return [
    'disableNormalFields' => [
        AuthorInstructions::class,
    ],
    'disableCommerceFields' => [
        DisabledProducts::class,
    ],
    'disableWidgets' => [
        RollYourOwn::class,
    ],
];

Multi environment config is supported. See Craft's docs for more info. See config/tools.php in this repo for an example on how to disable any field and widget.

Created by Supercool
Maintained by Spicy Web

统计信息

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

GitHub 信息

  • Stars: 54
  • Watchers: 5
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-10-18