This DokuWiki plugin provides functionality to assign tags to a wiki-page using checkboxes.
The tagentry plugin displays a set of tag-name checkboxes just below the edit form and automatically adds or modifies {{tag>}} in the wiki-text using JavaScript when a checkbox is activated.
This plugin can be installed standalone, but makes only sense in combination with a recent version (later than summer 2008) of the tag plugin.
There are a few configuration options available, accesible via the configuration-manager.
tagsrc | choose which tags to display. The default is to display all tags known to the tag plugin's index. Alternatively you can use the IDs of existing pages in a dedicated namespace (by default the tag plugin's namespace) |
|---|---|
namespace | IFF tagsrc is set to custom; search this namespace. |
table | Format checkboxes using a HTML <table> instead of just pushing them into a <div> |
limit | Maximum number of tags to list - 0:unlimited |
blacklist | Space separated list of tags to hide from the assignment-bar |
height | specify maximum height of the box in float(em,px,pt) format.>0: fixed value (eg. 50px); 0 or empty: use CSS; <0: scale with number of entries (fi. -1em should get you rid of the scroll-bar, -0.05em is a sane value for sites with many tags.) |
tablerowcnt | when using <table> formatting, this allows to specify the number of tags per table-row. (default:5) |
Note: the default max-height is currently defined in lib/plugins/tagentry/style.css as 5em.
ToDo:
<div> wrapper is still written; but the <label> will not be printed if $alltags is empty. check this when finishing layouting. META or some custom command similar to DRAFT on the Tag's -page)alert() messages translatable or remove them.helper.php in order to make them available for other plugins (fi. plugins:dokubookmark). As always: Comments, suggestions and patches or feedback of any kind is more than welcome. Put them here while I update the trac.
EDIT: found out the code was wrong. Line 261 should read: if ($i%$options['tablerowcnt']==0 && $i!=0) {
fixed in 0.3.2 (2009-09-18) - Thanks for pointing this out.
Fact remains that I can not set the tablerowcnt from the config manager.. I've added that to the config manager, as well.
Answer: As for your alternative approach: You can already make the checkboxes float. They're wrapped in a <label> environment which allows for width and float CSS paramters.
The CSS would look like this:
#plugin__tagentry_wrapper div.taglist label {
width: 50px;
overflow: hidden;
float:left;
}
I'm having a devil of a time configuring tagentry. What I desire is to limit what tags are listed by the namespace. Take the following example of namespaces:
namespace1:page1 namespace1:page2 namespace2:page1
When creating or editing pages in namespace1, I only want to display the tags specific to that namespace. I am unsure how to configure the tagentry plugin to do this. Up to this point the only way I get any tagentry checkboxes to display is to configure “Select which tags will be available” to “All tags” otherwise no checkboxes are displayed.
Answer: This is beyond the capabilities of this plugin. The feature you are requesting would require support from the tag plugin itself to group tags by namespace.
The tagentry-namespace configuration option is there for backwards compatibility with the old tag-plugin, which created pages in a specific namespace for each tag. The latest version of the tag-plugin still supports this, but does not create the pages automatically.
PS. There's is already a feature-request on http://www.dokuwiki.org/plugin%3Atag#limit_tag_list_by_namespace for that purpose.
Warning: Invalid argument supplied for foreach() in [wiki path]/lib/plugins/tagentry/action.php on line 170
Answer: That was a bug which occurred if there are were no tags defined on the system. - Cheers for reporting this.
A: per default it uses the tag plugin's topic.idx. Rebuild your tag index (available from Admin menu) to clean out old tags.
long Answer: Older versions of the tag-plugin required to create wiki pages for each tag, later versions use a '?do=showtag' action. The new version displays the page with the tag-name if it exists and else generates a topic listing.
Maybe you have older tags still sitting around as pages?
As for the scrollbar: there is no configuration option for that yet. You can edit set the lib/tpl/tagentry/style.css and adjust or remove the max-height parameter. You can also override it in your site's template. The number of tags per line is also still fixed and hardcoded to five. Well, this plugin's barely 3 days old; but we'll get there.height configuration option (available from v0.2.5 or later) to -1em. That adds one line per displayed tag to the max-height style parameter of the box. Horizontal scrolling - related to limiting the displayed tag-name - will be made configurable in a later version.
Fixed in version 0.3.0 (2009-01-30).
That sounds like the javascript of the plugin is not loaded or you've disabled Javascript in your browser. Try to flush the cache:
conf/dokuwiki.php` It worked, thx a lot!
Scrollbars are already automatically added if there's more than 6 lines of tags. The style.css defines:
overflow:auto; max-height:6em;
Simply modify the 'max-height' parameter (in …/lib/plugins/tagentry/style.css) with a text-editor to your preferences (eg. max-height:40px; )
Note: older versions of IE do not support max-height! Use height:6em;, but then the box will then always be fixed at this height and never shrink.
This plugin inspired by dokubookmark, generalizing the idea of graphically assigning tags on page-creation.
see also: