How do I disable the opml link and icon seen on the My Groups tab?

Comments

zd370’s picture

Hi

You have to comment out these lines of code from the og_view.module file:

These lines should be inside the function named og_views_views_pre_view(&$view, &$display_id, &$args)

Starting at line 206

  if ($view->name == 'og_my') {
    if (!$view->display_handler->get_option('header')) {
      $txt = t('You might be interested in an <a href="!url" rel="nofollow">OPML feed containing feeds from all your subscribed groups</a>.', array('!url' => url('community/opml')));
      
      $view->attachment_before = $txt;
    }
    if (!$view->display_handler->get_option('footer')) {
      $view->attachment_after = theme('opml_icon', url('community/opml'));
    }
  }

Ending at line 215

og_view.module file is located under og/modules/og_views

Sorry, there isn't any easier way to turn it off.

amitaibu’s picture

Status: Active » Fixed

You can delete it from inside the View itself (i.e. edit the OG view).

zd370’s picture

you can't actually... i tried it already.. this thing is hard coded in the module..
if there is a way.. could you point out where in the views..

zd370’s picture

Status: Fixed » Postponed (maintainer needs more info)
zd370’s picture

Status: Postponed (maintainer needs more info) » Active

oops.. sorry selected wrong status

askibinski’s picture

If you clone the view the OPML icon will be gone.

But I still think it's a bad thing this is hardcoded in the module.

ron collins’s picture

you can hide it by adding this to your theme's style.css:

.opml-icon {
display:none;
}

Plazmus’s picture

I found somewhere on drupal.org maybe not the best but quite easy solution.

Edit view and under 'Basic Setting' for Header and Footer insert:
<p></p>

That will do the job icon will disappear.

scottrigby’s picture

Commenting out OG code is not ideal.

Hiding with CSS is not so nice.

@Plazmus -- this is a nice & quick workable solution :)

TechnoBuddhist’s picture

Thx Plazmus - I found I only had to change the Footer insert to make it disappear.

I also used

 

to be fully compatible with xhtml standards I think I remember somewhere finding out that you shouldn't have an empty block, hence the non breaking space.

Plazmus’s picture

You posted space so we can't see the result ;)

That should be:

<p>&nbsp;</p>

Glad that I could help :)

TechnoBuddhist’s picture

DOH!!! Thx!

highvoltage’s picture

Just out of curiosity... Why is that there in the first place, let alone hard coded?

alextronic’s picture

petednz’s picture

certainly makes it disappear but also adds extra space under the block which makes it stand out. does seem odd that this isn't supplied as a 'feed display' that can then be dropped

alextronic’s picture

well then instead of <p></p> you could use <span></span>, but you're right, seems odd that this isn't supplied as a 'feed display'

aleada’s picture

My solution was to add a custom footer using php input filter ....

 echo("");

So the code inside the if does not executed .... ;)
if (!$view->display_handler->get_option('footer')) {
$view->attachment_after = theme('opml_icon', url('community/opml'));
}

It is not very nice practice to change the modules code even the hardcoded parts....

mrgavindb’s picture

Nice fix Plazmus. Very quick and easy.

joelstein’s picture

Status: Active » Fixed

The best solution I've found is to override theme_opml_icon() in your theme's template.php file:

function yourthemename_opml_icon($url) {
  return '';
}

No hacks, no weird Views work-arounds, no CSS, and no empty tags.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

kevstev01’s picture

I've been using Artisteer to generate my theme, and appended the [mytheme]_opml_icon($url) function to the generated template.php file but it's not being called (though the theme is enabled and working). I have created a development site and added logging into the og module, but can't seem to trace the call stack.
I have used the "footer" fudge by adding an HTML "more" link in the block content (I'm happy for the opml icon to appear on the page output, so this is good enough for now) but the purist in me wants a "proper" fix :o) Anyone able to help please?

(Drupal 6 installation)

zd370’s picture

@#21, kevstev01

did you clear your cache?

kevstev01’s picture

Doh! Thanks chintu84 - although I have caching disabled on my dev site, so I'm still a little confused, but it's all working now and my yin and yang are back in alignment again ;-)

zd370’s picture

In Drupal 6 & 7, your theme functions are cached, so each time you add/remove a function from your template files, you have to clear your cache.