Ive searched for info about this but cant find any relevant forum posts. Ive adapted the bluemarine theme (4.5.1), and now want to remove the XML button linked to the category feeds. I'm sure its simple, but cant make it happen. I would appreciate any help.

Comments

czarphanguye’s picture

Dear GSPerk,

Ok. Open up taxonomy.module and locate

$output .= theme('xml_icon', url("taxonomy/term/$str_tids/$depth/feed"));

Change to

/*$output .= theme('xml_icon', url("taxonomy/term/$str_tids/$depth/feed"));*/

All done. ;-)

zach harkey’s picture

The only way to remove orange xml button is to hack one of the core modules? That can't be right.

: z

carlmcdade’s picture

Since it pops up at about 6 different places the esier thing to do would be to go into theme. inc and change this code:

/**
 * Return code that emits an XML icon.
 */
function theme_xml_icon($url) {
  if ($image = theme('image', 'misc/xml.png', t('XML feed'), t('XML feed'))) {
    return '<div class="xml-icon"><a href="/'. $url .'">'. $image. '</a></div>';
  }
}

---------------------------
Hivemindz CMSopedia
__________________________
Carl McDade
Information Technology Consult
Team Macromedia

moshe weitzman’s picture

you are missing the whole point of the theme API. that function you want to edit is just the default implementation of _xml_icon().

this is easy to change. assume your theme is called 'shamu'. all you do is define the function shamu_xml_icon() in your theme. that function will return nothing in your case, since you don't want this feature. If you want it on some pages but not others, just wrap the current code within an if() block.

carlmcdade’s picture

I understand the overriding. But personally I would never go into that much complication for such a simple thing. Besides I hate those little icons anyway. I say hack it and be done with it :)

---------------------------
Hivemindz CMSopedia
__________________________
Carl McDade
Information Technology Consult
Team Macromedia

moshe weitzman’s picture

sure, you can do whatever you like on your site. but please don't go giving this advice in the forums because people read these posts and never learn about the right way to do themeing, or leave drupal thinking it is poorly designed.

i would expect that an IT consultant would not judge the addition of a single function to his theme as "too much complication".

adavidow’s picture

The nice thing about including the empty function in your specific theme's "template.php" file is that you don't have to redo anything when you update or upgrade. A part of me likes this just a little bit better than the css hack that follows, because here you simply the server from doing a few milliseconds of computing; by only zeroing out the display, the server does the computing and then moves on without displaying it. Still, both work.

templates.php

<? php
function mytheme_xml_icon(){}
?>
wonderland’s picture

Just wanted to add that the function is called theme_feed_icon now. So you have to place the following line into the template.php file of your theme:

function phptemplate_feed_icon($url) {
	return;
}

..- Wonderland

shoq’s picture

<< If you want it on some pages but not others, just wrap the current code within an if() block.>>

Ok.. I am still trying to get the hang of themes and drupal. SO be patient with me:)
I want to kill the feed icons sometimes, and not others. So how to do it the "drupal way?" I am trying hard, but getting impatient.

Here is the feed icon function, ready to be overridden (from theme.inc):

function phptemplate_feed_icon($url) {

return "my wrapped . $URL . here"

}

Since the function passes just a URL, how can my function know anything more about the node so I can make decisions based on page, node type, etc? Do I have to extract it from the URL itself? Is the current $node a global that is available here?

I really wish there were some drupal tutorials on the 10 most common things most non-programmers want to do. The handbooks can be overwhelming.

nevets’s picture

In the code above the image is inclosed in a div tag with a css class of xml-icon

You could use the following css and the image will not appear

.xml-icon
{
  display: none;
}
zach harkey’s picture

Trying real hard to figure out why this isn't the perfect solution...

I think it is.

I forget how easy and powerful css can be.

: z

carlmcdade’s picture

That works for me.
---------------------------
Hivemindz CMSopedia
__________________________
Carl McDade
Information Technology Consult
Team Macromedia

zevan’s picture

I took what I hope was the most recoverable and straightforward route -- I renamed the img files that are tied the link. feed.png and xml.png in the 'misc' folder. No more img, no more link. So far that's worked well.

nevets’s picture

If you look at you Drupal logs you will see you are probably producing page not found errors for each time the image is supposed to be displayed.

vm’s picture

hidding it using css if the easist way I think. Although the above css reference isn't correct anymore. I'm prety sure its feed-icon however, one could easily determine this using the FF browser and the web developer addon for more direction.

nevets is correct in that, just removing or renaming the image, is causing errors. browsers will still look for the image, even though you've removed or renamed it.

I suppose if someone REALLY wanted to be lazy, they could create a 1 pxl png file and overwrite the default feed icon.

lunatinker’s picture

on serious note, thanks for all the info on where to look.
my installation?
edited /drip/misc/feed.png and /drip/misc/feed.gif (different themes show different things).
if you remove from css, but allow users to choose themes, edit the fee icon just in case?

vm’s picture

yes it would have to be removed from every theme that uses it. some do, some don't.