Ir al contenido principal

Ralsina.Me — El sitio web de Roberto Alsina

Nikola Feature-by-request: tag cloud!

I asked for fea­tu­re re­ques­ts for Niko­la my sta­tic si­te ge­ne­ra­to­r. I got so­me. One was from lon­g-­ti­me user Kay Ha­yen, so I just could­n't say no.

He asked for tag clou­d­s. Look:

An­y­thing in he­re wi­ll be re­pla­ced on bro­w­sers that su­pport the can­vas ele­ment

Cu­te, is­n't it? And it's rea­l, ac­tual tag da­ta from this ve­ry si­te. Wi­th li­nks!

How it's do­ne:

Niko­la ge­ne­ra­tes a JSON fi­le that has the cloud da­ta (tag na­me, si­ze, li­nk), and tha­t's pro­ce­ss­ed by JQue­ry and ta­gCan­vas and ... we­ll, it wo­rks.

You have to add jquery.tagcanvas.min.js somewhere and embed a whole pile of raw HTML (see here for details) but hey, it works.

Ho­pe you are ha­pp­y, Ka­y, you ma­de me co­de ja­vas­cript, du­de ;-)

It's pro­ba­bly ra­ther "ea­s­y" to make it use any of the­se ins­tead of ta­gCan­vas if an­yo­ne is so in­cli­ne­d.

Kay Hayen / 2012-12-28 11:02:

Really, really happy now. The raw HTML, I see from the source, but Nikola master doesn't yet contain the code to create the JSON file, right?

Roberto Alsina / 2012-12-28 12:30:

Looks like I forgot to push it (duh!). I seem to be unable to push it right now on 2G, will try again as soon as connectivity improves a little.

Kay Hayen / 2012-12-28 12:31:

It's ok, take your time.

Roberto Alsina / 2012-12-28 12:35:

Looks like it got through now :-)

昭俊 孟 / 2013-02-24 11:38:

There's error so cloud tag broken:
"Uncaught ReferenceError: jQuery is not defined" in jquery.tagcanvas.min.js

Roberto Alsina / 2013-02-24 14:29:

That usually means the order of loading the .js files is wrong and it's loading tagcanvas before jquery :-(

Contents © 2000-2023 Roberto Alsina