Make RSS feeds item displayed even if Adblock plus hide it

Created on 19 November 2014, about 10 years ago
Updated 18 April 2024, 8 months ago

Hi all,

Aurélien PINCEAUX from Mobile Lives Forum (en.forumviesmobiles[dot]org) report me this and tell me to share the solution with the community. I don't think this is something to put in a patch for follow, but maybe somebody would like the same result.

The problem:
AdblockPlus hide the (internal) link for RSS feeds. In fact, the default config of this browser's plugin does not, but if you use the list "Fanboy's list" (and probably others), it hide almost all the content of "follow site" block. It's OK to let external links hidden, but better to keep internal links visible.

https://adblockplus.org/forum/viewtopic.php?f=2&t=25942

A simple solution:
Affect the render of the block with an implementation of hook_block_view_MODULE_DELTA_alter()
(it could also be in the theme with a custom template or a (pre)process custom function).

You can, for example, add the following code to your module: (obviously, replace MYMODULE by your module's name)

/**
 * Implements hook_block_view_MODULE_DELTA_alter().
 */
function MYMODULE_block_view_follow_site_alter(&$data, $block) {
  if (!empty($data['content']['follow-links']['this-site'])) {
    $data['content']['follow-links']['#suffix'] = (string) @$data['content']['follow-links']['#suffix']
      . render($data['content']['follow-links']['this-site']);
    unset($data['content']['follow-links']['this-site']);
  }
}
📌 Task
Status

Closed: outdated

Component

Code

Created by

🇫🇷France webastien

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • 🇺🇦Ukraine AstonVictor

    I'm closing it because the issue was created a long time ago without any further steps.

    if you still need it then raise a new one.
    thanks

Production build 0.71.5 2024