TAGMEPLUGIN_USER_AGNOSTIC_TAGGING%= is referred to by the plugin code only if multiple tag namespaces are there.
This is to override the installation-wide default of user conscious tagging or user agnostic tagging.
The installation-wide default is specified by =$TWiki::cfg{TagMePlugin}{UserAgnostic}=.
#TagsOnPage
---++ How to put tags on every page
To show the tag interface at the top of the page directly below the breadcrumb (like on twiki.org), use the default template =view.tagme.tmpl= in the templates directory.
This template is in fact a 'skin' template. To enable it, write in [[%LOCALTWIKIPREFS%]]:
* Set SKIN = tagme,pattern
The list of skins can be appended, for instance: =tagme,corporate,pattern=.
For the "blog" style, use for a simple "Tags: list-of-tags (edit)" at the top
of the page:
* Set SKIN = tagme_styleblog,pattern
And for an alternate style, with no tags line shown if no tags exists, and
the button to open the tag edit frame placed at the right of the Edit and
Attach ones, in the same style, on the upper right:
* Set SKIN = tagme_styleblogbutton,pattern
*For TWiki 4.1, use:*
* Set SKIN = tagme04x01,pattern
---+++ Customizing the appearance
If you customize your site you probably want to change overall appearance. You can find instructions how to do that - at least for default pattern skin - in [[%SYSTEMWEB%.PatternSkinCssCookbook]]. %BR%
The short summary is:
* Create an empty CSS file, for instance =sitestyle.css=
* Copy the CSS styles for =tagmetags= (see below at [[%TOPIC%#ExampleStyle][Example styles used on twiki.org]]) into the file
* Attach the file to [[%LOCALTWIKIPREFS%]]
* In [[%LOCALTWIKIPREFS%]], write:
* Set USERSTYLEURL = %PUBURL%/%USERSWEB%/TWikiPreferences/sitestyle.css
---+++ Other places for the tag interface
To show the tags in the top bar, edit [[%SYSTEMWEB%.WebTopBar]] and copy:
Tags: %TAGME{ tpaction="%URLPARAM{tpaction}%" web="%WEB%" tag="%URLPARAM{tag}%" }%, [[%SYSTEMWEB%.TagMeViewAllTags][view all tags]]
To show the tags at the bottom of every page, write in [[%LOCALTWIKIPREFS%]] assuming the skin's view template has =%WEBCOPYRIGHT%= at the bottom:
* Set WEBCOPYRIGHT = Tags: %TAGME{ tpaction="%URLPARAM{tpaction}%" web="%WEB%" tag="%URLPARAM{tag}%" }%, [[%SYSTEMWEB%.TagMeViewAllTags][view all tags]] %BR% Copyright © 1999-%GMTIME{"$year"}% by... etc
---+++ Show tags without vote buttons
To just show the tags for a topic, without buttons or "Create new tag" link, use a =showalltags= search:
Tags: %TAGME{ tpaction="showalltags" web="%WEB%" topic="%TOPIC%" format="$tag " }%
---++ Tag styles
---+++ CSS Styles
!TagMePlugin writes the following CSS styles:
| *Class* | *Used where* |
| =tagMeControl= | Around 'tags shown on a topic': tag link plus vote counter plus add/vote button |
| =tagMeVoteCount= | Around vote count number |
| =tagMeNotification= | =span=: One-line notification feedback after adding or removal of a tag and on in this process |
| =tagMeNotification= | =div=: Block of notification feedback after creation of a tag and on errors in this process |
| =tagmeAction= | Link style for buttons add and remove tag vote |
| =tagmeNavigation= | Table style for tabbed admin pages |
---++++ Search results CSS Styles
| *Class* | *Used where* |
| =tagmeRelated= | Text style of the line "Related tags (Click to refine the search)" |
| =tagmeResultsTable= | Table style for search results |
| =tagmeResultsTableHeader= | Table header with link to topic, last modified date and author. These have the additional classes =td.tagmeTopicTd=, =td.tagmeDateTd=, =td.tagmeAuthorTd=, =tagmeTopicTdWeb= |
| =tagmeResultsDetails= | Wrapper around =tagmeResultsSummary= and =tagmeResultsDetails= |
| =tagmeResultsSummary= | The topic summary |
| =tagmeResultsTags= | List of tags for the topic |
---+++ Preventing link wrap
If users are allowed to use spaces in their tag names (when ={TagMePlugin}{NormalizeTagInput}= is set to 0), tag links may break halfway to the next line. To prevent wrapping, add a wrapper =div= around the tags:
%TAGME{ ... }%
This CSS style is included in =tagme.css=:
.tagmeTagCloud a {
white-space:nowrap;
}
#ExampleStyle
---+++ Example styles used on twiki.org
To show the 'tags shown on a topic':
Tags: %TAGME{ tpaction="%URLPARAM{tpaction}%" web="%WEB%" tag="%URLPARAM{tag}%" }%, [[%SYSTEMWEB%.TagMeViewAllTags][view all tags]]
CSS styles:
.tagmetags select {
font-size:.8em;
margin:0 .25em;
}
.tagmetags a {
text-decoration:none;
white-space:nowrap;
}
.tagmetags a:link,
.tagmetags a:visited {
color:#8E9195; /* all links are gray; for blue links use: #06c */
text-decoration:none;
}
.tagmetags a:hover {
color:#FBF7E8;
}
.tagMeControl {
color:#8E9195; /* gray for non-links */
}
#PluginSettings
---++ Plugin Settings
%TWISTY{
mode="div"
showlink="Show details %ICONURL{toggleopen}% "
hidelink="Hide details %ICONURL{toggleclose}% "
}%
---+++ Configuration parameters
The %TOPIC% has the following settings in =LocalSite.cfg=.
* =$TWiki::cfg{TagMePlugin}{SplitSpace}= (default: 0)%BR%
If 1, then each top level web has its own tag namespace
* =$TWiki::cfg{TagMePlugin}{UserAgnostic}= (default: 0) %BR%
If 1, then user agonostic tagging is conducted. Otherwise, user conscious tagging.
* =$TWiki::cfg{TagMePlugin}{NormalizeTagInput}= (default 0) %BR%
When you add a new tag, the tag name is somewhat normalized.
If this parameter is 1, then the degree of normalization is higher -
a tag consists only of non-accented letters, numbers, or underscores.
To achieve that, spaces and hyphens are replaced with underscores,
characters other than non-accented letters, numbers, or underscores are eliminated, all uppercase letters are made lowercase.
If this parameter is 0, then the following characters are eliminated: ^#,'"|* %BR%
Other than that, no normalization is conducted.
* =$TWiki::cfg{TagMePlugin}{LogAction}= (default: 0) %BR%
If 1, then tag actions such as creation of a new tag, adding a tag to a topic are logged in the log file in the same manner as topic view and edit are logged.
* =$TWiki::cfg{TagMePlugin}{AlwaysRefine}= (default: 0) %BR%
If 1, then the =refine= parameter is always added to TAGME queries.
* =$TWiki::cfg{TagMePlugin}{TagLenLimit}= (default: 30) %BR%
Maximum length of a tag name
* =$TWiki::cfg{TagMePlugin}{Debug}= (default: 0) %BR%
If 1, then debug messages are put into the debug log file
---+++ Switching !SplitNamespace and/or !UserAgnostic
You may change ={TagMePlugin}{SplitSpace}= or ={TagMePlugin}{UserAgnostic}= after using %TOPIC% for a while.
This is not recommended, but you may need to do that.
So here's how you can deal with it.
---++++ Switching !SplitNamespace
If ={TagMePlugin}{SplitSpace}= is 0, all tag data, namely the tag set and which topic has which tags put by whom, is stored in the following directory:%BR%
=$TWiki::cfg{WorkingDir}/work_areas/TagMePlugin=
If the directory there are two kinds of files:
* =_tags_all.txt= - having the tag set
* _tags_WEB.TOPIC.txt (e.g. =_tags_TWiki.WebPreferences.txt=) - having who put which tag to which topic
If ={TagMePlugin}{SplitSpace}= is 1, tag data is stored in the =pub= directories of top level webs under the =.tags= subdirectory. For example, !WebA's tag data is stored in =pub/WebA/.tags=, !WebB's tag data is stored in =pub/WebB/.tags=, etc. Tag data file names and content are the same as they are under single tag namespace configuration.
As you see, under the multiple tag namespace configuration, tag data is not stored under =$TWiki::cfg{WorkingDir}=. Instead, it's stored under pub/WEB_NAME. This is to mirror a web simply by mirroring data/WEB_NAME and pub/WEB_NAME.
If you change ={TagMePlugin}{SplitSpace}= from 0 to 1, all webs become unable to see existing tag data since they refer to their own tag data, which is empty immediately after the switch.
There is no ready-made tool, but it's easy to move/copy tag data files from =$TWiki::cfg{WorkingDir}/work_areas/TagMePlugin= to pub/WEB_NAME/.tags.
The amount of information-wise, single tag namespace and mutliple tag namespaces are not different.
Though cumbersome, you can go back and force without losing information.
---++++ Switching !UserAgnostic
If ={TagMePlugin}{UserAgnostic}= is 0, tagging data in _tags_WEB.TOPIC.txt consists of lines for tags put to the topic. For example, if the user =john= (login name) put the tag =foo=, the file gets the following line.
001, foo, john
Then if the user =jane= put the tag =foo=, the line becomes as follows.
002, foo, john, jane
Even if ={TagMePlugin}{UserAgnostic}= is 1, the tagging data file format remains the same.
The difference is, when the tagging data file is read, each line is recognized as:
001, TAG, YOUR_LOGIN_ID
This means, if you switch ={TagMePlugin}{UserAgnostic}= from 0 to 1, all tags put by anybody are recognized as yours. Due to the way showing tags in user agnostic tagging, those tags are displayed as expected.
A tagging data file remains as it is unless a tag is added or removed. Then, the file is filled with lines of the following format.
001, TAG, YOUR_LOGIN_ID
And the information of who put which tag is lost.
Obviously, user conscious tagging houses more information than user agnostic tagging. So switching from user conscious to user agnostic has no problem. But the other way around causes a weird situation - all tags put to the topic A is by the user U while the topic B has tags tags put only by the user V.
%ENDTWISTY%
---++ Plugin Installation Instructions
This plugin is pre-installed. TWiki administrators can upgrade the plugin as needed on the TWiki server.
%TWISTY{
mode="div"
showlink="Show details %ICONURL{toggleopen}% "
hidelink="Hide details %ICONURL{toggleclose}% "
}%
* Download the ZIP file from the plugin web (see below)
* Unzip ==%TOPIC%.zip== in your twiki installation directory. Content:
| *File:* | *Description:* |
| ==data/TWiki/%TOPIC%.txt== | Plugin topic |
| ==data/TWiki/TagMeViewAllTags.txt== | Supporting topic to view all tags |
| ==data/TWiki/TagMeViewMyTags.txt== | Supporting topic to view my tags |
| ==data/TWiki/TagMeSearch.txt== | Supporting topic to search for tagged topics |
| ==data/TWiki/TagMeManage.txt== | Supporting topic to create new tags |
| ==data/TWiki/TagMeDebug*.txt== | Supporting topics for debug |
| ==lib/TWiki/Plugins/%TOPIC%.pm== | Plugin Perl module |
| ==pub/TWiki/%TOPIC%/*.gif== | Icon files |
| ==templates/view.tagme.tmpl== | Template containing GUI components |
* Configure and enable the Plugin:
* Run the [[%SCRIPTURL%/configure%SCRIPTSUFFIX%][configure]] script to enable the plugin
* Overload the Plugin settings as needed in the [[%LOCALTWIKIREFS%]]:
* Determine who will be allowed to rename and delete tags.
* For international character support: set =NORMALIZE_TAG_INPUT= to 0.
* To allow any user input as tag name also set =NORMALIZE_TAG_INPUT= to 0.
* To put the tags interface on every page, see the instructions above at [[%TOPIC%#TagsOnPage][How to put tags on every page]]
* Test if the installation was successful:
* Go to [[TagMeCreateNewTag]] and add a tag
*
__Note__: If you have upgraded !TagMePlugin to TWiki 4.2 or later and appear to have lost all your old tags: Copy all your tag files from =pub/TWiki/TagMePlugin/= files to =working/work_areas/TagMePlugin/= and they should magically re-appear.
%ENDTWISTY%
---++ Limitations
* TWiki 04-Sep-2005 and older: Tags are lost if a topic is renamed or moved.
---++ Plugin Info
%TABLE{ tablewidth="100%" columnwidths="170," }%
| Plugin Author: | TWiki:Main.PeterThoeny, TWiki:Main.ArthurClemens |
| Copyright: | © 2006-2018 Peter Thoeny, [[http://twiki.org/][TWiki.org]];
© 2006-2018 TWiki:TWiki.TWikiContributor |
| License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) |
| Plugin Version: | 2018-07-05 |
%TWISTY{
mode="div"
showlink="Show Change History %ICONURL{toggleopen}%"
hidelink="Hide Change History %ICONURL{toggleclose}% "
}%
%TABLE{ tablewidth="100%" columnwidths="170," }%
| 2018-07-05: | TWikibug:Item7841: Copyright update to 2018 |
| 2016-01-09: | TWikibug:Item7708: Copyright update to 2016 |
| 2015-02-16: | TWikibug:Item7604: Switch from GPL v2 to v3 |
| 2014-05-15: | TWikibug:Item7492: Hide tags in print using hideInPrint CSS class (requires PatternSkin 2014-05-15) |
| 2013-10-24: | Twikibug:Item7375: bug fixes, document improvement, code cleanup |
| 2013-10-23: | Twikibug:Item6816: tag add/delete/rename permission bug fixed |
| 2013-04-18: | TWikibug:Item7234: Problems when {TagMePlugin}{SplitSpace} is true |
| 2013-04-11: | TWikibug:Item7224: Using TWiki::Func::isAnAdmin() instead of non existing TWiki::Access::isAdminOrWebAdmin() |
| 2013-03-12: | TWikibug:Item7185: Rename $TWiki::cfg{PersonalWebName} to $TWiki::cfg{UsersWebName} |
| 2013-01-28: | TWikibug:Item7091: Use TWISTY in installation instructions and change history |
| 2012-12-03: | TWikibug:Item7034: Multiple tag namespaces support. -- TWiki:Main.YaojunFei |
| 2012-09-04: | TWikibug:Item6923: Nicer reporting pages with gray gradient tabs |
| 2011-07-12: | TWikibug:Item6768: Allow login name or !WikiWord name for =by=""= tag queries; user specific "no tag yet" message if =by= user is not logged in user |
| 2011-05-25: | TWikibug:Item6732: Fix for administrator not able to delete tag if Main web is renamed to User web |
| 2010-06-12: | TWikibug:Item6490: Fixing hardcoded link to TWiki web |
| 2010-05-26: | TWikibug:Item6433: Doc improvements |
| 23 Oct 2009: | Peter Thoeny: Validate tag against known tags when adding a tag; improved docs |
| 30 Aug 2008: | Colas Nahaboo: enhancements to the "blog" style: Bundles, count of known tags, option to delete tags |
| 28 Aug 2008: | Colas Nahaboo: prefix & suffix options renamed as header & footer. New parameter style to TAGME to be able to define different UI style for the default "show" action of TAGME. Implemented a first one, "blog" for the simpler case of authors managing the same tags |
| 26 Aug 2008: | Colas Nahaboo: prefix & suffix options to TAGME |
| 16 Oct 2007: | Arthur Clemens: added backward compatible example template. |
| 26 Sep 2007: | TWiki:Main.CrawfordCurrie TWikibug:Item4728 fixed incorrect cloud font sizes to reflect relative importance of tags actually being displayed |
| 11 Sep 2007: | Arthur Clemens: updated example template to TWiki template convention. |
| 11 Jun 2007: | Arthur Clemens: fixed sizing of tags with the same tag count; fixed CSS class for select box; updated documentation with "How to put tags on every page". |
| 07 Jun 2007: | Arthur Clemens: removed dependency on (unreleased) TWiki 4.2. |
| 21 May 2007: | TWiki:Main.WillNorris: added =view.tagme.tmpl= and updated installation instructions. |
| 30 Apr 2007: | Arthur Clemens: fixed calculation of sizes in tag cloud; if =mincount= is passed only the shown tags are calculated. |
| 18 Apr 2007: | Arthur Clemens: added permissions for rename and delete; added TagMeChangeRequests. |
| 17 Apr 2007: | TWiki:Main.CrawfordCurrie for [[http://www.escapestudios.co.uk/][Escape Studios]]: contributed support for incremental refinement of tag searches. |
| 12 Apr 2007: | TWiki:Main.CrawfordCurrie contributed ability to search for multiple tags. TWiki:Main.SvenDowideit for [[http://www.escapestudios.co.uk/][Escape Studios]]: added parameters needed for custom search result display. |
| 05 Apr 2007: | Arthur Clemens: The "topic tags" select box is now created with Javascript to prevent the tag options getting indexed by search engines. The former select box is used for noscript fallback. |
| 02 Apr 2007: | Arthur Clemens: Added "Delete Tag" interface. Added tabbed interface for Create, Rename, Delete tags. |
| 30 Mar 2007: | Arthur Clemens: Added "Rename Tag" interface. |
| 22 Mar 2007: | Arthur Clemens: Added option =NORMALIZE_TAG_INPUT= (to be set to 0) to allow any word as tag name (including upper case, punctuation characters and spaces). Moved "Create New Tag" to dedicated page. Created CSS styles in =tagme.css=. Added =mincount= parameter to =TAGME{tpaction="showalltags"}=. |
| 14 Nov 2006: | Fix IE browser crash issue on print (forms can't be named "tags"; debug by TWiki:Main.KevinKalmbach) |
| 14 Oct 2006: | Fix show default problem introduced by version 07 Oct 2006 (contributed by TWiki:Main.ChristianSuenkel) |
| 07 Oct 2006: | nostatus="on" parameter for add/remove tag (contributed by TWiki:Main.FredMorris) |
| 05 Oct 2006: | Fix issue of missing topics in tag search if topic name contains plus or minus sign (workaround for TWiki core TWikibug:Item2625 and TWikibug:Item2967) |
| 04 Oct 2006: | Fix issue of statistics moving !WebHome tags to !WebStatistics |
| 02 Oct 2006: | Support for topic rename (tags are no longer lost) |
| 14 Sep 2006: | MAKETEXT support (TWiki:Main.KoenMartens); fixed nested webs issue; fix in generated XHTML (TWiki:Main.ArthurClemens) |
| 20 May 2006: | Support international characters (contributed by TWiki:Main.AntonioTerceiro) |
| 09 May 2006: | Support for sub-webs; enclose tag list on topic in =span class="tagMePlugin"=; tag selector not shown if empty; limit max size of new tags to 30 characters |
| 21 Mar 2006: | !TagMeSearch with =minsize= and =maxsize= parameters; !TagMeSearch format with =$votecount=, =$size=; fixed !JavaScript compatibility issue on TWiki 4.0 |
| 11 Mar 2006: | !TagMeSearch with =sort=, =norelated=, =nototal=, =format= and =separator= paramters; linked tags in create new tag section; renamed !TagMeViewSpecificTag to a shorter !TagMeSearch; workaround for Dakar TWikibug:Item1838 to fix broken links in top bar |
| 06 Mar 2006: | Remove my tag vote; added exclude="", minsize="" and maxsize="" parameters; more intuitive icons; in default view, sort tags alphabetically instead of sort by tag vote |
| 03 Mar 2006: | Allow underscore in tags (and convert space and dash to underscore); added web="" and topic="" parameters; fixed font size issue in tag cloud with disproportional counts |
| 28 Feb 2006: | Use tabs in all/my/specific tags view; show related tags in specific tags view; check if topic exists when adding tags; |
| 26 Feb 2006: | Added view all tags / my tags (as tag clouds); view specific tag (sorted by tag count); do not allow guests to create new tags; log add/create tag actions |
| 20 Feb 2006: | Initial version |
%ENDTWISTY%
%TABLE{ tablewidth="100%" columnwidths="170," }%
| TWiki Dependency: | $TWiki::Plugins::VERSION 1.024 |
| CPAN Dependencies: | none |
| Other Dependencies: | none |
| Perl Version: | 5.8 |
| [[TWiki:Plugins/Benchmark][Benchmarks]]: | %SYSTEMWEB%.GoodStyle 100%, %SYSTEMWEB%.FormattedSearch 100%, %TOPIC% 99% |
| Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC% |
| Feedback: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Dev |
| Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Appraisal |
__Related Topics:__ %SYSTEMWEB%.TagMeViewAllTags, %SYSTEMWEB%.TagMeViewMyTags, %SYSTEMWEB%.TagMeSearch, %SYSTEMWEB%.TagMeDebugViewTags, %SYSTEMWEB%.TagMeDebugSearch, %SYSTEMWEB%.TWikiPlugins, %SYSTEMWEB%.DeveloperDocumentationCategory, %SYSTEMWEB%.AdminDocumentationCategory, %SYSTEMWEB%.TWikiPreferences
%META:FILEATTACHMENT{name="tag_add.gif" attr="h" comment="Button: add tag" date="1141691885" path="tag_add.gif" size="857" user="TWikiContributor" version="1"}%
%META:FILEATTACHMENT{name="tag_remove.gif" attr="h" comment="Button: remove tag" date="1141697484" path="tag_remove.gif" size="862" user="TWikiContributor" version="1"}%
%META:FILEATTACHMENT{name="alltagcloud.gif" attr="h" comment="Screenshot of view all tags tag cloud" date="1141693726" path="alltagcloud.gif" size="8087" user="TWikiContributor" version="1"}%
%META:FILEATTACHMENT{name="topictags.gif" attr="h" comment="Screenshot of tags on a topic" date="1141696674" path="topictags.gif" size="1945" user="TWikiContributor" version="1"}%
%META:FILEATTACHMENT{name="topictags_styleblog.gif" attr="h" comment="Screenshot of tags on a topic, closed" date="1219868858" path="topictags_styleblog.gif" size="12712" user="TWikiContributor" version="1"}%
%META:FILEATTACHMENT{name="topictags_styleblog_open.gif" attr="h" comment="Screenshot of tags on a topic, opened" date="1219868858" path="topictags_styleblog_open.gif" size="22259" user="TWikiContributor" version="1"}%
%META:FILEATTACHMENT{name="tag_addnew.gif" attr="h" comment="" date="1141696362" path="tag_addnew.gif" size="852" user="TWikiContributor" version="1"}%
%META:FILEATTACHMENT{name="tagme.css" attr="h" comment="CSS styles" date="1141696362" path="tagme.css" size="1349" user="TWikiContributor" version="1"}%
%META:FILEATTACHMENT{name="buttons_gradient.psd" attr="h" comment="Buttons design document (Photoshop format)" date="1141696362" path="buttons_gradient.psd" size="41686" user="TWikiContributor" version="1"}%
%META:FILEATTACHMENT{name="gray-gradient-1.png" attachment="gray-gradient-1.png" attr="h" comment="" date="1346791909" path="gray-gradient-1.png" size="339" user="TWikiContributor" version="1"}%
%META:FILEATTACHMENT{name="gray-gradient-2.png" attr="h" comment="" date="1346791204" path="gray-gradient-2.png" size="353" user="TWikiContributor" version="1"}%