Hey, I was wondering how to change the default RSS feed icon used in the syndicate block etc... I want to have a different colored icon for each theme.

I guess it will be with theme_feed_icon but I'm having trouble making it work.

Can anyone help?

Comments

kimangroo’s picture

While we're on the subject, how can I change what information is available in an RSS feed? For example if I wanted to remove authorship information from the RSS feed?

nicholasThompson’s picture

You could look into writing a small module which uses hook_nodeapi and picks up on the rss item operation? Not sure...

kimangroo’s picture

hook_nodeapi you say... I'll read up on it. It's about time I worked out how to write a module too.

hacking node.module for now

nicholasThompson’s picture

It is that function.

If you're using a PHPTemplate theme like Garland or Bluemarine, you can create a file called template.php in the theme's folder. In that, create a function with the same name as the theme function you want to override, but replace the 'theme' bit with the name of the theme OR 'phptemplate' (the render engine). For example...

function garland_feed_icon($url) {
  if ($image = theme('image', 'images/my_feedicon.png', t('Syndicate content'), t('Syndicate content'))) {
    return '<a href="'. check_url($url) .'" class="feed-icon">'. $image. '</a>';
  }
} 

Hope this helps :-)

kimangroo’s picture

Actually I realised that I explained myself badly.

Using that function I could point towards a custom feed icon for every theme that uses a seperate template file but I've got one main theme and then a bunch of sub themes with different css. I should have realised that that meant the only way then was to use css.

Thanks for the help anyway!

VM’s picture

to get a different one for each theme,

change feed-icon in your style.css file for each theme, adding the "other" feed images to the misc folder.

so in red themes style .css locate feed-icon and point to the red rss feed icon
then the blue in its style.css so on so forth.

kimangroo’s picture

I didn't think that you could do it in css.

After a bit of fiddling around, I put this in each theme style sheet and it seems to work nicely:


a.feed-icon {
display:block;
background-image: url('icons/feed.png');
margin-top:0.5em;
height: 16px;
width: 16px;
}

.feed-icon img {
display:none;
}

In each theme subfolder I've got an icons folder with a different feed.png in it.

Thanks for your help guys!