承接 sam-costigan/linkableobjects 相关项目开发

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

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

sam-costigan/linkableobjects

Composer 安装命令:

composer require sam-costigan/linkableobjects

包简介

Module for SilverStripe allowing Data Objects to be hooked into WYSIWYG link editor.

关键字:

README 文档

README

Maintainer Contact

  • Sam Costigan <sam (at) stripetheweb (dot) com>

Description

Add your custom Data Objects to the HTML Editor Field link functionality, with a Dropdown field that is populated by relevant results as the user searches.

Requirements

  • SilverStripe 3.0 or newer

Setup

To set up a DataObject to be linkable, first it needs to implement the Linkable interface. There are two requirements for a Linkable DataObject:

  • a Link() function which will return a relevant URL to display the Data Object.
  • a LinkTitle() function which will return a title string to display when searching for Data Objects.

The Link() function will need to return a relevant URL so that the Data Object will be displayed. For more information on how to do this, see http://www.ssbits.com/tutorials/2010/dataobjects-as-pages-part-1-keeping-it-simple/

When searching for DataObjects, the $searchable_fields array will be used to decide which fields are searched.

Example setup

class Test extends DataObject implements Linkable {
	
	private static $db = array(
		'Name' => 'Text',
		'Author' => 'Varchar(150)'
	);

	public static $searchable_fields = array(
		'Name',
		'Author'
	);

	public function Link() {
		return $this->ID;
	}

	public function LinkTitle() {
		return $this->Name . ' - ' . $this->Author;
	}
}

Once the DataObject has been set up to properly implement the Linkable interface, you need to add the following line to your mysite/_config.php file:

HtmlEditorField_LinkObjects::addLinkableObject('Test');

Your DataObject will then be added to the HTML Editor Field links section.

Feedback

Feel free to make this module better by submitting feedback, changes, suggestions etc!

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2015-08-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固