{{tag>tag_with_multiple_words}}
Also, quotes seem to work:
{{tag>"tag with multiple words"}}
==== 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)) true;
// Replace underscores with blanks
foreach($data->data['meta'] as &$meta) {
if($meta['name'] == 'keywords') {
$meta['content'] = str_replace('_', ' ', $meta['content']);
$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