17 votes

Sniper Systems Tags Control

 

This package is a datatype to replace the built in Umbraco 4 Tags Control.

It is based on the jquery.tagsinput.js and jquery.autocomplete.js libraries and is (should be) backwards with the native tag control.

It also implements a Razor Model Data Type - umbracoDocumentNode.tagsProperty will be a List<string>

The tag control will autocomplete based on tags attached to other documents.

Use , [comma] to seperate tags or hit enter (if not autocompleting) to add a tag.
They will automatically turn green as they're added. 

v1.0.4399.4
Fixes an issue with the RazorDataTypeModel not applying correctly.
Check the documentation tab for the 7zip file tagtest.7z which is a webmatrix example site demonstrating the control

v1.0.4406.14
Restyles the autocompleter dialog to match the tag area and fixes having multiple instances on the same document type. Please note tagtest.7z was not updated in this release.

v1.0.4408.27
Fixed an issue where multiple tag panels on the same document type didn't remove tags in the correct panel when the tag existed in both.
Fixed backwards compatibility with native tag panel (assuming tag group is set the same).
Fixed issue with tag control not inserting/deleting tags properly when groups were used.
Fixed issue where the second tag control on a document type would clear the others tags on save

v1.0.4520.4 
Adds an extension method to DynamicNodeList which allows you to select all the tags for that list. (no counts - so no tag cloud, just the tags for the list)
dynamic list = Model.Children;
var tags = list.SelectManyTags("propertyAliasForTags")
=> IList<string>

v1.0.4524.9
Fixes publshing of nodes via the metablogapi (umbraco channels) - now you can use this control when publishing blog posts from Word/Live Writer

v1.0.4525.3
Fixes the razor data type model so it doesn't return an empty List for versions >= 1.0.4524.9 

v1.0.4525.6
Now the data type model works when you only have 1 tag

v1.0.4790.5
Added support for an event which you can subscribe to.
If you do, the tag control will call this event when it wants the group name, passing in some information such as the current node, node id, document type alias, parent document type alias and the current group name from the prevalues.
To use this event, create a class inheriting from application base and subscribe to the static event exposed on Sniper.Umbraco.Tags.Events; GroupNameNeeded.
If you don't set the group name (property on the EventArgs) in the handler, it will use the one from the prevalues as this is the "default" that is passed into the EventArgs.
If you don't subscribe to the event, the prevalue is used as-is and the control will not attempt to call it.
Sample event handler class can be found in files -> Sniper.Umbraco.Tags.GroupNameExample
This enhancement was requested so that the tag control can be used for multiple languages using the parent node to specify the group name.

v1.0.4805.3
Fixed an issue where raising the event for group name would throw an exception if your node was unpublished

v1.0.5046.1
Fixed an issue where the tag control did not support nvarchar properly and this meant international characters couldn't be used in tags. Issue affected 4.x and 6.x. If using 4.x make sure you change the cmsTags table to be nvarchar - this has been changed in 6.x by default. 
(Thanks to Joseph for the bug report)

v1.0.5101.6
Fixed tags containing ' not saving properly (Thanks to Matt for the bug report)
Fixed tags which were only whitespace saving (they are now ignored)
Fixed tags which were blank saving (they are now ignored) - this fixes a bug where if you saved a node with no tags specified the control would mistakenly create a blank tag in the database (Thanks to Joseph for the bug report)
Fixed/Speed improvement for saving nodes that have no tags by shortcircuiting the merge/upsert logic

v1.0.5219.13
Upgrade jquery.tagsinput.js from 1.3.1 to 1.3.3;
Fix conflict with autocomplete between uComponents XPath autocomplete and tags autocomplete

v1.0.5368.2
Fix issue in Umbraco 6.2 where autocompleter didn't work due to changes in jQuery ajax request handling

Screenshots

Source code

Package owner

Gareth Evans

Gareth Evans

Gareth has 335 karma points

Package Compatibility

This package is compatible with the following versions as reported by community members who have downloaded this package:
Untested or doesn't work on Umbraco Cloud
Version 8.18.x (untested)

You must login before you can report on package compatibility.

Previously reported to work on versions:

Package Information

  • Package owner: Gareth Evans
  • Created: 14/12/2011
  • Current version 1.0.5368.2
  • License MIT
  • Downloads on Our: 8.2K

External resources