glFusion Wiki

Site Tools


Tag Plugin for glFusion


The Tag plugin enables you to put “tags” in your content which makes it easier to classify similar content types. For example, you may have a story about vegetables, so you use the vegetable tag. Another story may be about squash, so you use the squash and vegetable tags. Now the story about vegetables and the story about squash are related.

You can display a Tag Cloud on your site, which will show the active tags in your content, using larger fonts for those tags with higher use. User's can select a tag and see all content items that share that tag. The Tag Plugin will also show related tags, which other tags associated to the content.

The Tag Plugin can also replace the What's New section in a story, providing a much better set of related stories (or other content, your choice).

This plugin enables you to better classify your content and your users the ability to find content easier.

The Tag Plugin supports most of the glFusion plugins, including, Stories, Calendar, Static Pages, DokuWiki and Media Gallery. There are some plugins that Tag does not support, specifically, Forum, Paypal, Polls, Forms, and GeoLocator.


The Tag Plugin has the following system requirements:

  • PHP 5.3.3 and higher.
  • glFusion v1.6.3 or newer

The Tag Plugin uses the glFusion automated plugin installer. Simply upload the distribution using the glFusion plugin installer located in the Plugin Administration page.


Tag v2.0.0 is a complete rewrite which requires some special upgrade handling when upgrading from earlier versions.

Once you have uploaded the latest Tag Plugin through the glFusion Plugin Administration screen and selected upgrade, you will need to do the following:

  1. Navigate to the Command & Control → Tag administration screen.
  2. Select Rescan Content. This will rescan all glFusion content and rebuild the tag mappings.

Once you have completed the steps above, you should be ready to go.


The Tag configuration option are available in the Configuration section located in Command & Control. These configuration options allow you to enable features or control functionality of the Tag plugin.

Default name for Tag Cloud Block
The default name of tag block which will be created during the installation. If you disable/enable the tag plugin, the block will also be disabled/enabled automatically.
Tag Name
Tag name to be used in items (articles), like 'Tag: foo'. You might prefer a shorter name like '[t:foo]'.
Maximum length of a tag in characters
Maximum number of characters allowed in a tag. Should not be longer than 128 characters.
Tag Case sensitive
If this is true, the tag “glFusion” will NOT be identified with the tag “glfusion”. When you change this option, you should Rescan Content (available in the Tag Administration Screen).
Use list of ignored words
Whether to use a list of ignored words. If a tag is regarded as ignored, it will be replaced with the text specified in the blank automatically.
String to be used as spacer in Tag Cloud
A string to be used as a spacer in displaying tag clouds
Max number of tags in Tag Cloud
Maximum number of tags to be displayed in tag clouds in public_html/tag/index.php. If this is set to 0 (zero), the tag cloud will not be displayed.
Max Number of tags in Tag Cloud Block
Max number of tags to be displayed in tag clouds in side block
Threshold of Tag Levels
Thresholds of frequency of each tag cloud level. All tag clouds are classified in 10 levels (level 0..level 9). Those tags whose number is equal to or smaller than the threshold setting [X] belong to level X. Each level corresponds to its own class in CSS (Cascading Style Sheet), so you can display in different styles tags according to their levels.
Replace an underscore with a space
Whether to replace an underscore included in tag texts with a space when a tag is displayed.
Max number of keywords
The number of key words to be included in <meta name=“keywords” content=“foo,bar”> tag. If the number is 0, the meta tag won't be included.
Publish tags as template vars
If this is set to true, tags will NOT be displayed where they should be in the article, but will be published as template vars ({tag_label} and {tag_part}) which can be used in 'storytext.thtml', 'featuredstorytext.thtml', and 'archivestorytext.thtml'. If this is set to false, tags will be displayed in the article.
Display glFusion Blocks
Defines which blocks should be displayed (i.e.; left / right ) when displaying the tag interface.
Replace Story What's Related
If this is enabled, the Tag plugin will generate a list of content items (not limited to just stories) that are related based on the tags in other content. This provides a much better set of related items than the default What's Related.
Maximum number of items to return in What's Related
This is the maximum number of items to return in the What's Related section.
Allowed content types for What's Related (comma delimited list)
This options allows you to limit which content types (i.e.; plugins) should be included in the What's New section of an article. This is a comma separated list of plugin names to allow. For example, if you wish to allow tags in other articles to be used, media items from Media Gallery, but do not want calendar events listed, you would enter the following:

The What's New section will now only pull tags from other articles and Media Gallery items.
If this is blank, all content types with tags will be used.


Entering tags in your content

The method you enter tags into your content is by placing the tag: auto tag into your content. To create a tag called foo, you would enter the following:


If you want to have more than one tag associated to your content, simply enter additional tags separating each one with a space like this:

  [tag:foo bar]

If you would like to register words as one tag, such as “Zend Framework”, you should enter “Zend_Framework”. By default, tags are case-insensitive. For example, the tag “glfusion” will be identified with “glfusion” or “GLFUSION”.

When you save the content (i.e.; save the story), the Tag plugin will scan the content and extract the tags you entered and now they are part of the Tag mapping. The tags will now be part of the Tag Cloud or other tag items.

Ignore Tags

As you continue to add tags to your content, you may find that a tag is simply too generic or used it too many places so it is no longer providing value. Instead of editing all of your content to remove it, you can tell the Tag plugin to ignore it. Ignored tags are still stored in the Tag mappings, but will no longer be included in any results. This allows you to change your mind if needed.

If your site allows users to contribute content, you may find some inappropriate words being used. This would be another case where ignoring tags is helpful.

Display Tag Cloud

If you would like to display “tag clouds” in your site block, just create a PHP block with the function name being phpblock_tag_cloud. This block is create automatically during the plugin installation.

You can tweak the appearance of the Tag Cloud by adjusting the styles in the Tag style sheet located in the public_html/tag/tag.css file.


Tag List

This displays all active (non-ignored tags) in the system. You can see the how often the tag has been used (frequency) and how many times it has been clicked. If you click on the tag from the tag list, it will show all content where the tag is used.

You can select tags to be ignored - check the box next to the tag(s) you wish to ignore and choose Ignore Tags at the bottom of the list.

Ignore List

This is a list of tags in the ignore list. You can choose to stop ignoring tags by selecting the checkbox next to the tag and selecting Allow Checked Tags at the bottom of the list.

Rescan Content

Rescan content will scan through all content on your site and rebuild the Tag mappings. This is a resource intensive task that generally does not need to be run. Cases where this may be useful are:

  • If you uninstalled and then re-installed the Tag plugin - you need to rescan the content
  • Upgrading from versions prior to v2.0 - you need to rescan the content to ensure everything is mapped properly

Customizing the Look & Feel

tag.css is where the styles are kept

FIXME - document what each style does and where it is used

Cool Tricks

If you use tags in all of your articles - you may want to set the Publish tags as template vars configuration to True and add the tags to the bottom of your articles. This will provide a consistent method to display the articles tags for all articles.

  {!!if {story_display} == 'article' !!}
    {!if tag_label}
      <div class="uk-alert uk-alert-success">
        <i class="uk-icon uk-icon-tag"></i>&nbsp;{tag_part}

This code will only display when viewing the full article and will show the tag block at the end of the story.

You can do something similar in the Media Gallery templates as well. For example, edit view_image.thtml and place the following where you want the tag list to show:

    {!if tag_label}
      <div class="uk-alert uk-alert-success">
        <i class="uk-icon uk-icon-tag"></i>&nbsp;{tag_part}

Auto Tags

The Tag plugin uses the [tag] auto tag to map tags to content. You also have another auto tag that you can use to display a Tag Cloud:


How to use the [ tagcloud:## auto tag ]

License / Credits

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

The Tag Plugin was originally developed by mystral-kk - geeklog AT mystral-kk DOT net for geeklog.

glfusion/plugins/tag/start.txt · Last modified: 2017/04/10 04:18 (external edit)

Page Tools