CodeIgniter Forums
Taggly, a tag-cloud library - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: Taggly, a tag-cloud library (/showthread.php?tid=4093)

Pages: 1 2 3 4


Taggly, a tag-cloud library - El Forum - 11-06-2007

[eluser]Gavin Vickery[/eluser]
Hey Everybody,

I've been working on one of my first libraries for CI called Taggly. Taggly is used to easily create tag-clouds. You can also control how your tag-cloud is created by setting configuration options.

You can download Taggly, along with its user guide here:
Download Taggly

============================================

What is a Tag-Cloud?
A tag-cloud is a collection of text links with varying size (and sometimes color) based on their popularity. Sites such as Flickr, Delicious and Tag-A-Cloud use this concept.

What does it look like?
See Taggly in action

What is the syntax?
The syntax in its very basic form is this:
Code:
$myArray = array (
    array(10, 'PHP', 'http://php.com'),
    array(32, 'MySQL', 'http://mysql.com'),
    array(5, 'CSS', 'http://css.com')
);

echo $this->taggly->cloud($myArray);

You can get more complex by passing configuration parameters:
Code:
$configArray = array (
    'min_font' => 20,
    'max_font' => 60,
    'html_start' => '<li>',
    'html_end' => '</li>',
    'shuffle' => TRUE,
    'class' => 'my_css_class'
);

echo $this->taggly->cloud($myArray, $configArray);

Taggly Output
Taggly creates and returns links with defined sizes based on the data given in your array.

An example output:
Code:
<a style="font-size: 21px" class="taggly" href="http://example.com" title="Hue">Hue</a>
<a style="font-size: 18px" class="taggly" href="http://example.com" title="Image Ready">Image Ready</a>
<a style="font-size: 33px" class="taggly" href="http://example.com" title="Background">Background</a>
<a style="font-size: 33px" class="taggly" href="http://example.com" title="CodeIgniter">CodeIgniter</a>
<a style="font-size: 16px" class="taggly" href="http://example.com" title="Encode">Encode</a>
<a style="font-size: 23px" class="taggly" href="http://example.com" title="Depth">Depth</a>
<a style="font-size: 29px" class="taggly" href="http://example.com" title="Grafix">Grafix</a>
<a style="font-size: 18px" class="taggly" href="http://example.com" title="Adobe">Adobe</a>

You can find more information in the User Guide included in the Taggly download package.


Taggly, a tag-cloud library - El Forum - 11-06-2007

[eluser]CI Lee[/eluser]
Hi Gavin,

Funny that you have released this as its on my writeboard as something I need.... Now it is gone Big Grin

I am going to give it a run...


Thanks Gavin,
-Lee


Taggly, a tag-cloud library - El Forum - 11-06-2007

[eluser]Gavin Vickery[/eluser]
Hey Lee,

Glad it could help you out! Let me know if you have any trouble with it. I've tried making it as user friendly as possible. Smile

Any suggestions you may have would be appreciated.

Gavin


Taggly, a tag-cloud library - El Forum - 11-06-2007

[eluser]CI Lee[/eluser]
Can you make it butter toast?

Seriously though... a demo maybe so someone can see what you envision before having to download and code it in.

-Lee


Taggly, a tag-cloud library - El Forum - 11-07-2007

[eluser]gtech[/eluser]
I have never come across the tag cloud concept, so I had to hunt google to find out.. so I agree a demo/quick explanation would be useful. this link provides [url="http://www.petefreitag.com/item/396.cfm"]a quick explanation[/url]


Taggly, a tag-cloud library - El Forum - 11-07-2007

[eluser]Gavin Vickery[/eluser]
Hmm, yea I guess I didn't think of that. A demo would be beneficial. I'll get started on one and post it soon.

Thanks Lee and gtech


Taggly, a tag-cloud library - El Forum - 11-07-2007

[eluser]Gavin Vickery[/eluser]
Ok, I've updated my first post with a demo and some syntax examples. Hope that helps Smile


Taggly, a tag-cloud library - El Forum - 11-07-2007

[eluser]llbbl[/eluser]
Nice job Gavin.

Can you make a wiki page also please?


Taggly, a tag-cloud library - El Forum - 11-07-2007

[eluser]mironcho[/eluser]
Thanks Gavin!


Taggly, a tag-cloud library - El Forum - 11-07-2007

[eluser]Gavin Vickery[/eluser]
Wiki page created. Taggly Wiki.