Skip to content

subdesign/codeigniter-daptags

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Daptags Codeigniter tag cloud library

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.


Dependencies

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.

Installation

  • 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

Setup

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

Usage

example/index()

Generates the tag cloud and shows it in the view.

example/article($id)

Loads an article with the corresponding tags with it

example/tag($tag)

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.

example/add()

CRUD - Create method, for saving tags

example/edit($id)

CRUD - Update method, for editing tags (remove if deleted, add if new entered)
$id - id of the article

example/status($id)

Setting the status of article makes it's tags hide or show
$id - id of the article

example/delete($id)

Delete all tags which the deleted article contained.
$id - id of the article

Caching

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.

License

MIT License

Author

C. 2012 Barna Szalai b.sz@devartpro.com

Feel free to contant me if you have any questions!

About

Tag cloud library for Codeigniter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages