Go to file
Ingo Schommer 2cf314c09e Fixed travis build URL 2015-04-19 22:55:40 +12:00
code 3.1 $allowed_action changes compatibility 2013-07-02 09:57:24 +01:00
css MINOR: Updated the tag css to look nicer and easier to read. 2010-12-19 21:04:38 +11:00
javascript Add a default delay of 300ms on ajax requests. 2013-05-07 20:06:59 +12:00
lang MINOR Added language tables for TagField 2008-11-05 21:26:06 +00:00
tests 3.1 compatibility 2013-05-30 21:28:03 +12:00
thirdparty/jquery-tags BUGFIX Fixed ajax suggestion link in field 2009-09-12 00:19:38 +00:00
.travis.yml Merge remote-tracking branch 'origin/0.4' 2013-06-12 11:12:32 +02:00
CHANGELOG MINOR updated changelog 2009-02-01 06:48:02 +00:00
LICENSE ENHANCEMENT Improved customTag support 2008-09-30 18:12:17 +00:00
README.md Fixed travis build URL 2015-04-19 22:55:40 +12:00
_config.php moved tagfield into proper folder structure 2008-09-30 16:04:04 +00:00
composer.json Fix composer constraints 2013-10-01 10:11:27 +01:00

README.md

TagField Module

Build Status

Maintainer Contact

  • Ingo Schommer (Nickname: ischommer) <ingo (at) silverstripe (dot) com>

Requirements

  • SilverStripe 3.0 or newer
  • Database: MySQL 5+, SQLite3, Postgres 8.3, SQL Server 2008

Download/Information

Introduction

Provides a Formfield for saving a string of tags into either a many_many relationship or a text property. By default, tags are separated by whitespace. Check out a [http://remysharp.com/wp-content/uploads/2007/12/tagging.php](demo of the javascript interface).

Features

  • Bundled with jQuery-based autocomplete library (http://remysharp.com/2007/12/28/jquery-tag-suggestion/) which is applied to a textfield
  • Autosuggest functionality (currently JSON only)
  • Saving in many_many relation, or in textfield
  • Static list of tags without hitting the server
  • Tab-autocompletion of tags
  • Customizeable tag layout through css
  • Unobtrusive - still saves with Javascript disabled
  • Full unit test coverage

Usage

Tags as Objects

Article Model

class Article extends DataObject {
	static $many_many = array(
		'RelationTags' => 'Tag'
	);
}

Tag Model

class Tag extends DataObject {
	static $db = array(
		'Title' => 'Varchar(200)',
	);

	static $belongs_many_many = array(
		'Articles' => 'Article'
	);
}

Formfield Instanciation:

$tagField = new TagField('RelationTags', null, null, 'Article')

Tags as Textfields

Article Model

class Article extends DataObject {
	static $db = array(
		'TextTags' => 'Text'
	);
}

Formfield Instanciation:

$tagField = new TagField('TextTags', null, null, 'Article')

Static Tags without Autosuggestion

$tagField = new TagField('TextTags', null, null, 'Article');
$tagField->setCustomTags(array('mytag','myothertag'));