So, I found a solution – not as elegant as I wanted, but… yeah, well..
I actually wrote the same code above just in jQuery:
var link = "[detail]".length;
if (link > 10) {
$("LINK SELECTOR").css("display","block");
}
else {
$("LINK SELECTOR").css("display","none");
}
Thanks brain.