Daptags is a simple but powerful library generating tag clouds. You can put tags even after your article, and when setting an article item status to inactive, corresponding tags will be hidden, too. Hovering a tag in tag cloud a popup shows the count of articles they contain the tag. The tags have a separate table, where the corresponding article ids are stored in serialized arrays.
Strict dependency: Base_Model by Jamie Rumbelow
You have to install it to use this library!
Optional dependency: Cache Spark by Phil Sturgeon
If you want a simple file based cache then use this library.
-
Copy the necessary config, library and model files into the same folders on your machine.
Example controller and views doesn't have to copied, they are only theoretical "visual" examples how can you use this library, and integrate into your system. This readme uses the example controller for demonstration purposes. -
Insert the daptags.sql into your database
-
Use css styles in your stylesheet (in tags_index.php view) for setting the tag elements size
Edit the daptags.php config file.
- $limit - limit the number of tags in tag cloud
- $divider - html tag(s) for dividing tags
- $tags_order - ordering tags alphabetically ascending or descending
- $tag_container - class name of the tag cloud containing DIV
- $cache - Enable or disable file cache
- $cache_ttl - Cache lifetime settings in ms
Generates the tag cloud and shows it in the view.
Loads an article with the corresponding tags with it
Displays the articles after clicking a tag in tag cloud
Note: the library uses shortened uri like /tag, you have to create a route in the routes.php.
CRUD - Create method, for saving tags
CRUD - Update method, for editing tags (remove if deleted, add if new entered)
$id - id of the article
Setting the status of article makes it's tags hide or show
$id - id of the article
Delete all tags which the deleted article contained.
$id - id of the article
Using cache you can speed up tag cloud. Enable it in the config file after you installed Cache spark. You can also set the TTL value of the cache.
C. 2012 Barna Szalai b.sz@devartpro.com
Feel free to contant me if you have any questions!