lonely
camomiletea
Constance - Make tea, not war
Back Navigation Forward
Constance - Make tea, not war: dear diary

Thanks to murks_lv's insightful suggestion, I filtered my tags page by usage of tags. That is so cool. Well, not really. I have stopped tagging this journal a while ago, and it's messed up, etc. I'm planning to do this on my other journal muravei, which could use it, and make it more pretty.

Last tag also appears twice, so I'll need to adjust something in code.


Comments
default

why not to use something like this:

function Page::lay_print_VTL(){
var TagDetail[] VTL = $this->visible_tag_list();

if (size $VTL > 0) {
lay_start_sidebox("birkas", "tēmas");
foreach var int i (0 .. (size $VTL - 1)) {"""<a href="$VTL[$i].url">$VTL[$i].name ($VTL[$i].use_count)</a>\n""";}
lay_end_sidebox();
}
}

?


default

That will merely print those in an alphabetical order. I already have something similar, just disabled:

function print_tags(Page p) {
	var Tag[] visibletags = $p->visible_tag_list();
	var int counter = 0;
	var string list;
	var string text;
	foreach var Tag t ($visibletags) {
		if ($counter == size ($visibletags)) {
			$list = $list + """<a href="$t.url">$t.name</a>""";
		} else {
			$list = $list + """<a href="$t.url">$t.name</a><br />""";
			$counter++;
		}
	}
	$text = box_item($list);
	print_box("Tags", $text);
}


It was before the TagDetail and $t.use_count, but basically the same idea. I could update it, but I don't really want it.

Just experimenting with Tags page was interesting, and I like the ability to sort tags by number of times they were used... Shows immediately the most popular tag, etc.


(Anonymous) - (no subject)
default

I tried it quickly, but it didn't work. It was alphabetical sort.


default

sorry, obviously I was too deep in my own thoughts, and wrote what I believed the reality is. Are you still interested in the correct(-ed) code?

However, my personal preference still would be an alphabetic list, with frequency shown after the tag - actually, depending on the situation you could wish both alphabetic and frequency sorting, but a human eye detects the highest numbers almost automatically, so you usually don't need an extra sorting by the frequency.


Back Navigation Forward

Add a little sweetness to your day
Chocolate covered
raisins, cherries, orange slices and strawberries
all count as fruit,
so eat as many as you want.

April 2016
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30  

Log In/Out
Username:
Password: