Hilfe:Wiki Category Tag Cloud

Aus Webis

Wechseln zu: Navigation, Suche

Kopiert aus http://wiki-tools.com/wiki/Wiki_Category_Tag_Cloud

Vorlage:Infobox

There were a few very big issues with the YetAnotherTagCloud extension, so we've created a derivative which fixes bugs, makes it work better, and improves functionality.

Improvements

  • The original YATC extension had some odd use of LOWER() inside the SQL queries (I have no clue why the creators did something like that) and it basically ended up breaking any category which had an uppercase letter anywhere other than the first letter. Not only that but the links showed up with ugly underscores. So we fixed it so that links always work, and normal styled space links with normal capitalization are displayed.
  • The original extension only let you tweak background, border, and link colors. And there was no class. Not only that but those hard coded styles didn't work right on some skins with a right sidebar (it overflowed over the right) and you couldn't fix it. We've removed those old bits, and added actual parameters to the tag cloud (like a HTML tag uses) to add extra classes and style it. All tag clouds have a default tagcloud class so the normal styles can be kept through some CSS in MediaWiki:Common.css.
  • On the original extension you needed to specify pages to invalidate cache for in an array in the code. Which meant adding a tag cloud on the wiki required source modifications. Not a good idea... So we tweaked the function to allow for the titles of articles to be specified in MediaWiki:Tagcloudpages (one per line).

Usage

These in text parameters from the original extension still work the same:

min_count
Only display a tag for the category that contain at least min_count articles. Default value : 0.
min_size
Defines the minimum text size. (Default: 77).
increase_factor
Defines the factor to increase the text size by the number of articles. Default value : 100.
exclude
Defined the categories you do not want to be displayed. Use comma to separate the categories, like this:
<tagcloud>exclude=television,celebrities,food,yoga</tagcloud>

makes "television", "celebrities", "food" and "yoga" categories not to show up in the categories cloud.

The coloring in text parameters do not work anymore, instead we have XML parameters:

class
Adds CSS classes to the tag cloud itself (The tagcloud class is always included).
style
Adds CSS styles to the style parameter of the tag cloud.
linkclass
Adds CSS classes to the links.
linkstyle
Adds CSS styles to the links' style parameters.

in text parameters are place in between the two tags, and XML parameters are done inside the opening tag. Here's an example use showing where things are placed.

<tagcloud style="background: black;">
min_size=55
exclude=browse
</tagcloud>

Installation

Checkout the extension from subversion using:

checkout Vorlage:Svn repo url extensions/WikiCategoryTagCloud/

Or you can checkout the entire repo of Wiki-Tools extensions into a nice wiki-tools directory which lets you put Wikimedia extensions in the extensions/ folder without the two SVN repos colliding.

checkout Vorlage:Svn repo url extensions/wiki-tools/

Or if you really do not wish to use subversion you may grab a tarball snapshot Vorlage:Svn repo url.

And include one of the following lines into your LocalSettings.php depending on how you grabbed the extension:

<source lang="php"> require_once( "$IP/extensions/WikiCategoryTagCloud/WikiCategoryTagCloud.php" ); require_once( "$IP/extensions/wiki-tools/WikiCategoryTagCloud/WikiCategoryTagCloud.php" ); </source>

You should include this code into your MediaWiki:Common.css to get the default styles. After that you can freely tweak it: <source lang="css">

.tagcloud {

width: 98%; text-align: center; background-color: #FDFDFD; border: 1px solid #EEEEEE; padding: 15px 10px 15px 10px;

}
.tagcloud a {

color: #0052CB; margin-left: 10px; margin-right: 10px; font-weight: bold;

}

</source>

Finally, add the pages to invalidate the cache for to MediaWiki:Tagcloudpages (one title per line).

Persönliche Werkzeuge
KONTAKT