{{tag>tag_with_multiple_words}}
Also, quotes seem to work:
{{tag>"tag with multiple words"}}
==== How to make the tag namespace breadcrumb still work ====
Let's use one of the example websites.
If you go to https://wiki.psiconauti.net/tag/esperienze?do=showtag&tag=esperienze and then click in the breadcrumb "esperienze" you go to https://wiki.psiconauti.net/tag/esperienze , an empty page.
To make your pages inside the tag namespace always go to the tag list, add this to the beginning of your /.htaccess
This also allows you to keep your start page to add there, for example, the list of tags
If your [[config:startpage|start page]] is not "start", change it to the one you use
RewriteCond %{REQUEST_URI} !tag:start
RewriteRule ^tag.([\-_a-zA-Z0-9\ ]*)$ tag:$1?do=showtag&tag=$1
==== Change CSS styles depending on existing tags ====
This colors the background of the page to red if the keyword 'deprecated' is specified as a tag.
function _handle_keywords(&$data) {
global $ID;
// Fetch tags for the page; stop proceeding when no tags specified
$tags = p_get_metadata($ID, 'subject', METADATA_DONT_RENDER);
if(is_null($tags)) return;
// Replace underscores with blanks
foreach($data->data['meta'] as &$meta) {
if($meta['name'] == 'keywords') {
$meta['content'] = str_replace('_', ' ', $meta['content']);
// add extra styling
$t = explode(',', $meta['content']);
if(in_array('deprecated', $t)) {
$data->data['style'][] = array('type' => 'text/css',
'_data' => '.dokuwiki .page {background-color: red;}');
}
}
}
}
==== Customizing the breadcrumbs ====
If you add at ''pagelist/helper.php''
function tpl_youarehere2_help($id){
$result = '';
global $conf;
global $ID;
global $lang;
// check if enabled
if(!$conf['youarehere']) return false;
$parts = explode(':', $id);
$count = count($parts);
// always print the startpage
$result .= html_wikilink(':'.$conf['start']);
// print intermediate namespace links
$part = '';
for($i=0; $i<$count - 1; $i++){
$part .= $parts[$i].':';
$page = $part;
if ($page == $conf['start']) continue; // Skip startpage
// output
$result .= ' » '.html_wikilink($page);
}
// print current page, skipping start page, skipping for namespace index
resolve_pageid('',$page,$exists);
if(isset($page) && $page==$part.$parts[$i]) return $result;
$page = $part.$parts[$i];
if($page == $conf['start']) return $result;
$result .= ' » '.html_wikilink($page);
return $result;
}
function tpl_youarehere2($id) {
$str = $this->tpl_youarehere2_help($id);
$pos = strrpos($str , '»');
if ($pos == -1)
return $str;
return substr($str, 0, $pos);
}
function addPage2($page) {
$id = $page['id'];
if (!$id) return false;
$this->page = $page;
$this->_meta = NULL;
// priority and draft
if (!isset($this->page['draft'])) {
$this->page['draft'] = ($this->_getMeta('type') == 'draft');
}
$class = '';
if (isset($this->page['priority'])) $class .= 'priority'.$this->page['priority']. ' ';
if ($this->page['draft']) $class .= 'draft ';
if ($this->page['class']) $class .= $this->page['class'];
if(!empty($class)) $class = ' class="' . $class . '"';
$this->doc .= DOKU_TAB.''.DOKU_LF;
$this->_pageCell($id);
if ($this->column['date']) $this->_dateCell();
if ($this->column['user']) $this->_userCell();
if ($this->column['desc']) $this->_descCell();
foreach ($this->plugins as $plug => $col) {
if ($this->column[$col]) $this->_pluginCell($plug, $col, $id);
}
$this->doc .= DOKU_TAB.' '.DOKU_LF;
$this->doc .= DOKU_TAB.''.DOKU_LF;
$this->doc .= DOKU_TAB.DOKU_TAB.'';
$this->doc .= $this->tpl_youarehere2($id);
$this->doc .=' '.DOKU_LF;
$this->doc .= DOKU_TAB.' '.DOKU_LF;
return true;
}
And change ''tag/action.php''
$pagelist->setFlags($flags);
$pagelist->startList();
foreach ($pages as $page) {
$pagelist->addPage($page);
}
to
$pagelist->setFlags($flags);
$pagelist->startList();
foreach ($pages as $page) {
$pagelist->addPage2($page);
}
After that, the list of pages that contain the tag, except for the names of pages themselves under them will also be bread crumbs to these pages.
==== Bad appearance when displaying tags at top of page ====
:!: Integrated to main code (see ''tags_list_css'') option
When you insert the syntax at the top of a wiki page, the output of the plugin will be displayed below the TOC (Table of Contents). To make the visual appearance more smooth, change your ''lib/plugins/tag/style.css'' to the following code:
div.dokuwiki div.tags {
border-top: 2px dotted __border__;
font-size: 95%;
text-align: right;
/* clear: both; */
}
==== How to change the word tag and topic to another language ====
> Is it possible to change the word tag used in syntax to something else, like another language
$this->Lexer->addSpecialPattern('\{\{tag>.*?\}\}', $mode, 'plugin_tag_tag');
//e.g. Spanish:
$this->Lexer->addSpecialPattern('\{\{etiqueta>.*?\}\}', $mode, 'plugin_tag_tag');
===== Discussion =====
==== Pagelist With Alphabetical Headers ====
Is there a way to group pages by the first letter of their name or header?
Something like the example in this post on the user forums? https://forum.dokuwiki.org/d/12198-alphabetical-ordered-pages-list
> No.
Collapsible outline of all tags?
My ideal tag "cloud" display would have an alphabetic list of all tags. Click on a tag to expand (unfold) the display, and it would show an alphabetic list of pages that include that tag. We would want typical flags, such as for specifying namespaces, and display (like nspages), plus limiting tags (perhaps with RegEx?).\\
--davidtango 2021-03-21
---
I want the description under the tag, is it possible to make a line brake or to get the description under the tag? Thx
Is there any tip for hierarchical tag? I try to categorize my pages. For example, there are two pages. A Persian cat page has {tag>animal:cat}. And a Dalmatian dog page has {tag>animal:dog}. If I write '{topic>animal}, I hope to see the two pages, but all I can see is blank. Yes, I can tag that {tag>animal dog}, {tag>animal cat}, but it is not fancy.
For __**bugs or feature requests, there is the bug tracker**__ linked here : [[https://github.com/dokufreaks/plugin-tag/issues|Bug tracker]].
This plugin clashes with the include module of the mediasyntax plugin. One workaround is to disable that part of the mediasyntax plugin by renaming the include.php file.
If you have a tag name that is the same as a page name that already exists, the tag links will point to that page in the current namespace rather than the page name in the tag namespace. Is this a bug or a feature? (3-Aug-2011)?
> Found the issue. If you do not specify a namespace, it defaults to whatever is defined as the default namespace (ie. root:tag). If you do specify a namespace, it makes whatever you specify as the location for the data file (ie. root:mynamespace), NOT root:tag:mynamespace.
* Is there no way to display all used tags? This would be very useful for finding typos and (nearly) duplicate entries. (2012-02-21)
* Sry, me stupid, it works with count... **BUG** except that the table-entries are empty in my wiki! Latest DW/Plugin, with %% ~~NOCACHE~~ %% [[http://imgur.com/73Yuj|Screenshot]]. Sry for not registering at github for this.
* In most of my installation it works, in some not... clueless!
* How to sort the taglist (count>+) alphabetical?
[[http://openwiki.kr|My wiki]] has about 7000 pages with tags. It takes 25 seconds to display ~~TAGCLOUD~~ (My server runs with latest NGINX, UBUNTU 12.04, 4 core i5 cpu with 8gb ram, intel SSD ). Anyone have any other suggestion? or Do I need SQL-based tagging solution? --- [[user>goldseed|S.C. Yoo]] //2014/04/19 06:02//
Individual Search Form: I'd like a form where the user could just type in the tag name, click search, and then a list is generated below. I know you got the searchtags but its just going to get unwieldy with the amount of tags I'm envisioning having. Thanks
Structured Tags: Can this (or any other plugin) support structured tags in addition to free-form tags? -- //2014-09-02//
== Blank pages ==
I'm using Dokuwiki under Debian, last version in Debian distro. I installed plugin tags, but don't work :(
All page with %%{{tag>name_tag}}%% results a blank page, including the content of the page. I don't know what don't work but, I can't use it :(
> I am using Debian Wheezy and I am having the same issue.
»»»»» Hy, I think the tag should be separted by a ",". I mean what happen if I wanna tag "New York City" ? In present is created separte tag for "new" "york" "city" and that's not really good. --- [[user>adrianvesa|A.V]]
== Nothing was found. ==
Same here, get a Nothing was found page.
(2017-03-28) I had the same problem. By coincidence, I switched to the default Dokuwiki template for an unrelated reason and got a different error when I clicked a tag link: "Helper plugin pagelist is not available." Installed the pagelist plugin and then it worked. This dependency needs to be documented.
== SEO meta keywords ==
Does this plugin alter the meta tags of the rendered pages? If it doesn't, I would like to leave the suggestion. --- [[user>Fabricio Rocha|Fabricio Rocha]] //2016-06-11 17:00//
== Sorting the {{count>}} results ==
Is there any way to sort the output of the %%{{count>}}%% command? I'd like to have a page of used tags in alphabetical order, but it seems that [[pagelist]] parameters are not supported. --- [[user>Fabricio Rocha|Fabricio Rocha]] //2016-06-19 19:42//
This can be achieved by editing the ''helper.php'' file of the plugin. Before the ''return $otag;'' line within the function ''tagOccurrences'', just insert the line ''ksort($otags);'' and that's all. IMO this should be standard behavior. --- Taylan
In the current version for dokuwiki "kaos", you need to put the line ''ksort($tagOccurrences);'' just before the statement ''return $tagOccurrences;'' --- Jim
== Unorderd List of all tags? ==
Is there a way to gen an unorderd list of all tags, similar as {{count>+}}, but without table and occurrences?
== Filtering the list of Tags? ==
Hi, I have attempted to try an solve this but my apologies as I do not know enough about PHP. I use some tags on the site to create dynamic links and I was wondering if there is a way to have the tagsearch have the capability to ignore certain tags. In this case I start the dynamic tags with dw_ and would like to know if possible to filter out all the tags that start with dw_. Thanks for any help! Frank.
== Add "*" to list all the tags under a tag namespace? ==
I need a function to add all the tags under a tag namespace to the tag list.\\
That is, when I have a ns1:tag1, ns1:tag2, ..., ns1:tagN, I can use {{topic> ns1:*}}
to show all the pages with the tag under the namespace ns1. It is quite useful because sometimes I just want to show the pages with a sub tag, but sometimes I want to show all the pages with these tags on a main page. Since the tags under ns1 may be added in the future, I do not need to change the main page code to add more tags.\\
Now the tag namespace cannot be managed, I hope the basic function can be added.\\
2021-6-28
---
==== Columns? ====
2024-12-23
Is there a way to show the countlist or topic list (or just a list of tags) in a multicolumn format? I tried using the WRAP plugin, but that did not work.