DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:cloud

This is an old revision of the document!


Cloud Plugin

Compatible with DokuWiki

Anteater, Rincewind, Angua, Adora Belle, Weatherwax, Binky, Ponder Stibbons, Hrun, Detritus

plugin Show a cloud of the most frequently used words in your wiki

Last updated on
2016-01-16
Provides
Syntax
Repository
Source
Requires
(searchstats), (tag), pagelist

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Similar to cumulus

Tagged with listing, navigation, search, tags

Download plugin-cloud.tgz

Description

This is a very simple plugin that shows a cloud of the most frequently used words in your wiki:

~~CLOUD~~
~~CLOUD:number~~

Optionally you can specify the number of words to display. Default is 50. Allowed are numbers between 1 and 999. Each of the words is linked to the search result page for it. The words are styled in a way that more frequent words are bigger and have a darker link color.

You can exclude words from the word cloud by adding them each on its own line to inc/lang/[lang-code]/stopwords.txt or to conf/stopwords.txt. Remember that last line in file should be empty to work correctly.

This plugin can also make a “tag cloud” now! (tag plugin must be installed) The syntax is also simple:

~~TAGCLOUD~~
~~TAGCLOUD:number~~
~~TAGCLOUD:number>namespace1:subns11|.|namespace2~~

It also supports clouds for the most searched words in the wiki (searchstats plugin must be installed):

~~SEARCHCLOUD~~
~~SEARCHCLOUD:number~~

Development

Changes

  • 2013-02-27:
    • Fixed stopwords. Note that stopwords are only for the word cloud and not for the tag or searchstats cloud.
    • Added different text sizes for the searchstats cloud
    • Changed HTML output to be valid when more than one cloud is used on a page, if you had adapted the colors/styling of the tag cloud you need to adapt your CSS (the cloud id was changed into a class).

Most recent code changes:

Bugs/Feature Requests

Please report bugs and feature requests at the Bug Tracker.

Demo

The plugins page of dokuwiki.org presents a tag cloud that refers to all pages in the plugin name space.

Site using this plugin

FAQ

Caching for clouds

Hi, is it possible to cache the cloud? If i activate the plugin on my page, it slows down my system very much.

You can enable the caching feature by setting $renderer→info['cache'] = false; in syntax.php line 74 to true.

Whitespaces in Tags

Use underscores to specify whitespaces in tags.

Cloud in Windows-Server

You run cloud on a Windows server. The stylesheet style.css must be edited to hold Windows linebreaks rather then Unix. This solved the same problem for me. Ruud

More than one Cloud on a page

When you have more than one cloud (eg. a word and a tag cloud) on a page you end up with invalid HTML because each cloud has the same id (<div id="cloud">…), id's must be unique within a page.

Fixed int he 2013-02-27 version — Michael Hamann 2013/02/27 23:50

Discussion

The old discussion has been moved to discussion_old and will be cleaned up sooner or later. Please add bug reports and feature requests to the bug tracker of the plugin!

Related to the previous suggestion for tagcloud; If the first heading exists in a page of the specified tag, I'd like the tag-clouds to appear the first heading of the tag page.

I have one problem that the size of each tag remain the same, does not change. I am using a sandy.

SEARCHCLOUD Size

When a searchcloud is rendered, the size of each search term remains the same (cloud5). Kludgy fix:

After

     $cloud = $helper->getSearchWordArray($num);

Add

     ksort($cloud); // optional, changes sort from hit count to alphabetical
     if ($num != 50) { // if not the default cloud size
       $min=1;         // set the minimum to 1 to ease the tiny text problem
     } else {
       $min=true;
     }
     $max=true;
     foreach ($cloud as $word => $size) {
       $min = min($size,$min);
       $max = max($size,$max);
     }
(Different) fix is in the 2013-02-27 version — Michael Hamann 2013/02/27 23:50

Stopwords in tag clouds?

I was trying to remove some tags from the tag cloud as I have nested tags as a structuring element but due to this, certain tags appear much more often than others (the 'folder' tags). However, the described methods (include stopwords.txt in conf/ or inc/lang/) apparently do not work for tag clouds. Is there some way to have the clouds behave the way I would like them to? — Cantello 2011/11/30 19:40

stopwords are only for the word cloud, not for the tag cloud. I consider adding a similar (but differently named) blacklist for the tag cloud. — Michael Hamann 2013/02/27 23:50

patch to fix stopwords

@Cantello — I've attached a simple one-liner patch that helped me fix the same problem. It turns out that there's a single space that's not trimmed from the $stopwords array in the syntax.php file… hence array_search($key, $stopwords) never returns True.
— skipliquid # skipliquid # at # g # mail # dot # com
2012/1/31 14:00

cloud_stopwords-fix.diff
--- syntax.php.orig     2012-01-31 14:24:50.000000000 -0500
+++ syntax.php  2012-01-31 14:47:57.849347682 -0500
@@ -142,6 +142,7 @@
         $swfile = DOKU_CONF.'stopwords.txt';
         if (@file_exists($swfile)) $stopwords = array_merge($stopwords, file($swfile));
 
+       $stopwords = array_filter(array_map('trim', $stopwords));
         $cloud = array();
 
         if (@file_exists($conf['indexdir'].'/page.idx')) { // new word-length based index

Thanks @ skipliquid! Where do I have to implement that code or the file? Best regards, flu.

A different fix for this problem is in the 2013-02-27 version. — Michael Hamann 2013/02/27 23:50

Using Dokuwiki release Adora belle with tag and cloud plugin:

Some of my tags and some of my page names equal. If such a tag appears in the tagcloud, the cloud item will link to the page with the equal name and not to the list of pages, that are tagged with the tag.

Julian 2013-02-16

This is intentional in order to give you the possibility to add a description for that tag on this page. You can use the topic syntax of the tag plugin in order to add the list of pages to the description of the tag. — Michael Hamann 2013/02/16 13:45
Thank you!

Manolito 2013-02-21

Can we force the tag's link in cloud to a page defined in advance in subnamespace ? By default, the link leads in a page autogenerated like “tag:tag1”. I would like to report “tag1” in address like “en:tag:ns1:ns2:tag1”. This is my way of organizing the navigation menu almost auto-generated which created this particular request… and with plugin multilingue it's better too. — Alinea 2013/03/09 12:17

Tag namespace feature request

It would be nice if you could also control what tag namespace to use as it is with page namespaces now.

For example, you tag some of your pages with topic1, topic2, myCategory:subTopic1, myCategory:subTopic2 and then you create a tagcloud restricting it to myCategory to get only subTopic1 and subTopic2 listed there.

Seykela 2013/02/22 15:59
I agree with this, it would be a great feature!
Fernando Ribeiro 2013/05/02 14:41
I would also like to see this functionality. It would be excellent if (just as in the SEARCHCLOUD syntax) a cloud could be generated from the resullts of a TagFilter plugin listing.— JD4x4

Show the number of occurences for each tag

Could you please tell me how can i show the number of occurences of each tag of the cloud, such as keyword(number)..

Thank u

Steve 19/08/2013

plugin/cloud.1462371589.txt.gz · Last modified: 2016-05-04 16:19 by 195.94.244.147

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki