hi, feedapi is working great, I have the latest installed. I created a new content type called "news" and all the new feeds items are created as "news" items. unfortunately, they always have a link back to the "feed" content even if I unpublish the feed. not a huge deal, but I was wondering if there was anyway to remove that link. The "original article" link gets lost in the shuffle somehow, I'd rather readers just be able to click on that with out distracting them with too many other links. And there really isn't much meat for readers on the "feed" page, just a link to the main site where the RSS originates.

Comments

eyecon-1’s picture

Easy. In feedapi_node.module, Goto function feedapi_node_link

Comment out the line 'href' => 'node/'. $feed->nid,

That's it. I did this because it creates problems with Google if you have unpublished feed items.

petronikus’s picture

Thanks. That was super easy. I also commented out the line above it:

'title' => t('Feed:') .' '. $feed->title,

to eliminate the text as well as the link.

petronikus’s picture

Status: Active » Closed (fixed)
wallbay1’s picture

Status: Closed (fixed) » Postponed (maintainer needs more info)

hi guy I am not a coder could you tell me how to comment out?

lias’s picture

Is there a way to do this using your template.php file and overriding the function rather than making the change to the module code itself?

@wallbay1

To change it in the module go to the feedapi/feedapi_node directory and open the feedapi_node.module.

Comment out line 102 and 103 (or thereabouts) like so:

// 'title' => t('Feed:') .' '. $feed->title,
// 'href' => 'node/'. $feed->nid,

stormsweeper’s picture

@Isabug

This should work for items that are only coming in from one feed:


yourtheme_preprocess_node(&$variables) {
  $node_links = $variables['node']->links;
  if (!empty($node_links['feedapi_feed'])) {
    unset($node_links['feedapi_feed']);
    $variables['links'] = !empty($node_links) ? theme('links', $node_links, array('class' => 'links inline')) : '';
  }
}

Multiple feed items are trickier, since the key will be feedapi_feed_nid.

lias’s picture

thank you stormsweeper very much for the code! i do appreciate it.

alex_b’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Not a FeedAPI issue.

Rob T’s picture

Thanks, stormsweeper.

One thing -- I have feed items coming in from multiple feeds, and your code still works (so far) in ridding the Feed URL link from feed item nodes. Hopefully it will stay that way since that's what I want.

Rob T’s picture

Turns out I needed this solution again. However, the stormsweeper code I was using was actually a modified version, inserted into my template.php's "function mytheme_preprocess_node".

Just in case I find myself looking once again for the solution (and stumbling yet again into this thread), here she is...

// Removes feedapi_feed link from node links (link to feed)
  $node_links = $vars['node']->links;
  if (!empty($node_links['feedapi_feed'])) {
    unset($node_links['feedapi_feed']);
    $vars['links'] = !empty($node_links) ? theme('links', $node_links, array('class' => 'links inline')) : '';
  }
Rob T’s picture

Yet another update. Ran into issue with multiple feeds. Ended up going with lsabug's solution in #5 (as much as I hate modifying modules).

quickcel’s picture

I just released a new module that deals with part of your problem it looks like, but it doesn't remove the whole feed link. Might serve as a good springboard to what you want to do: http://drupal.org/project/feedapi_la