flxlabs/silverstripe-dataobject-links 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

flxlabs/silverstripe-dataobject-links

最新稳定版本:3.0.0

Composer 安装命令:

composer require flxlabs/silverstripe-dataobject-links

包简介

Adds links to data objects in TinyMCE editor

README 文档

README

Add links to DataObjects from within the TinyMCE editor

Introduction

Using this module you can link to DataObjects from within TinyMCE.

Requirements

  • Silverstripe CMS ^6
  • silverstripe/htmleditor-tinymce ^1

Setup

You can either add this module to your composer file using

composer require flxlabs/silverstripe-dataobject-links

or download the git repository and add a folder called dataobject-links to the top level of your project and drop the code in there.

Configure

In your settings .yml file put a section with

FLxLabs\DataObjectLink\DataObjectLinkModalExtension:
  classes:
    Team:
      name: Team
    Player: Player
      name: Player
      sort: Title

Where classes is a map from ClassName to display name that is used when selecting the DataObject.

Make sure to run /dev/build?flush to load in your config changes.

Usage

In TinyMCE's Insert link menu there will be a new entry Link to an Object at the very top. Use that to link to an Object of one of the classes that is listed in your config.

When generating the link this module will call the Link method on a DataObject. Override it to provide a link to your DataObject.

// This code doesn't actually work, it's just an example
public function Link() {
  return DataObject::get()->first()->Link() . $this->ID;
}

统计信息

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

GitHub 信息

  • Stars: 6
  • Watchers: 1
  • Forks: 7
  • 开发语言: JavaScript

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2018-08-13