I'm using this component to display a list of countries.
I'd like the links to be links to subscribe to the feed for that term, rather then just the link to the term's page.

I looked in the code but i can't find how to change the link to the feed link.

Any help would be greatly appreciated!

-D

Comments

nancydru’s picture

Assigned: Unassigned » nancydru

It would take me a while to figure out, but it sounds reasonable.

h_dries’s picture

Status: Active » Fixed

I used one of your block code snippets instead of taxonomy list, changed link to feed link and added an rss icon.
(I also changed tables to DIV's since I know css better then tables.)

here's the code:

  $vid = 3; /* <---- put correct vocabulary ID here */
  $num_cols = 5; /* <---- put number of columns here */
  $show_pic = module_exists('taxonomy_image');
  $rssicon="<img src= \"files/rss/feed-icon-14x14.png\" >";/* <---- change path if necessary */
  echo '<div class="use-pin">';
  $items = array();
  $terms = taxonomy_get_tree($vid);
  foreach ( $terms as $term ) {
    $count = taxonomy_term_count_nodes($term->tid);
    if ($show_pic) { $pic = taxonomy_image_display($term->tid /*, 'align="left"'*/); }
    else {$pic = NULL; }
    $name_and_count = l($pic . $term->name,'taxonomy/term/'.$term->tid."/0/feed", NULL, NULL, NULL, NULL, TRUE)." (".$count.")".$term->description;
    $items[] = '<div class="item">'.'<div class="rssicon">'.$rssicon.'</div>'.'<div class="namecount">'.$name_and_count.'</div>'.'</div>' ;
  } /* end foreach */
  if (count($items)) {
    if ($num_cols == 1) {
      echo theme('item_list', $items);
    }
    else {
    $slice = ceil(count($items) / $num_cols);
    echo '<div class="feedlist"><div class="feedcolumn">';
    for ($i = 0; $i < $num_cols; ++$i) {
      $start = $i * $slice;
      $class = $i % 2 ? 'even' : 'odd';
      echo '<div class="'."insidefeedcolumn". $class .'" name="top">';
      echo theme('item_list', array_slice($items, $start, $slice));
      echo '</div>';
    }
  echo '</div></div>';
  }
  }
  else { echo 'No terms found'; }
  echo '</div>';

and the css, (not well tested, but at first sight ok, at least in FF2)

/*news feeds listing page style*/

.use-pin .feedlist .feedcolumn .insidefeedcolumnodd .item-list ul li {

list-style:none;

}

.use-pin .feedlist .feedcolumn .insidefeedcolumneven .item-list ul li {

list-style:none;

}


.use-pin .feedlist .feedcolumn .insidefeedcolumnodd .item-list ul li a {

color:#60646d;

}

.use-pin .feedlist .feedcolumn .insidefeedcolumneven .item-list ul li a {

color:#60646d;

}

.use-pin .feedlist .feedcolumn .insidefeedcolumnodd .item-list ul {
background-color:#f2f1f6;
border:none;
width:120px;
float:left;
}

.use-pin .feedlist .feedcolumn .insidefeedcolumneven .item-list ul {
background-color:white;
border:none;
width:120px;
float:left;
}

.use-pin .feedlist .feedcolumn .insidefeedcolumnodd{

float:left;
}

.use-pin .feedlist .feedcolumn .insidefeedcolumneven{
width:16 px;
float:left;
}

.rssicon{
opacity:0.9;
width:16 px;
float:left;

}

.namecount{

width:80 px;

}

post it where you want.

Greet,

D

nancydru’s picture

I just committed this change to the -dev version. Please check it out when it rolls up (midnight GMT).

nancydru’s picture

Status: Fixed » Closed (fixed)