Adding custom vars with a block
You could add a theme preprocess function for blocks to add some logic pushing variables into your block template. You can then check against those variables to output the title as a link etc.

THEMENAME_preprocess_block(&amp;$vars) {
 //logic here to add variables
}