If this is already easily doable, I apologize but I've not been able to figure it out. Is there a way to allow the legend's terms to be clickable links back to the taxonomy term? This would be tremendously helpful I would think...

Comments

gowriabhaya’s picture

Issue summary: View changes

I had similar need only today. I looked into giving an easy solution, at the end I had a custom code to do this. Pasting the block of code I wrote in my custom module:

function aetc_block_view_alter(&$data,$block) {
    global $base_url;
    $taxterm = array();
    $i = 0;
    if (($block->module == "calendar") && ($block->delta == "calendar_legend")) {
        $tmp = $data['content'];
        $beg = strpos($tmp,"<td>",0);
        $end = strpos($tmp,"</td>",$beg);
// get all calendar taxonomy terms in an array
        while ($beg && $end) {
          $orgtext = substr($tmp,$beg+4,$end-$beg-4);
          if ((strlen($orgtext) > 0) && (strlen($orgtext) < 25)) {
             $replace = array(" & "," ");
             $text = str_replace($replace,"-",$orgtext);
             $text = strtolower($text);
             $taxterm[$i]['term'] = $orgtext;
// link it to the taxonomy page
             $taxterm[$i++]['url'] = '<td><a href="'.$base_url.'/calendar/'.$text.'">'.$orgtext.'</a></td>';
          }
          $beg = strpos($tmp,"<td>",$end);
          $end = strpos($tmp,"</td>",$beg);
       }
// find calendar taxonomy term in legend block and replace it with its page url
       foreach ($taxterm AS $term) {
          $thisterm = '<td>'.$term['term'].'</td>';
          $url = $term['url'];
          $data['content'] = str_replace($thisterm,$url,$data['content']);
       }
  }
}
apaderno’s picture

Category: Feature request » Support request
Neslee Canil Pinto’s picture

Status: Active » Closed (outdated)

Hi, there will be no more future development for 7.x branch. If you see this issue in 8.x, feel free to file an issue. Close this as Outdated.