Hi - I can't figure out how to keep my custom pager from showing up in nodes when they appear in an RSS feed. I use a node type template to cause the pager to show up in a certain place on the site itself, but when those nodes are sucked into RSS, every one has an unstyled custom pager at the top of it, since RSS just pulls in all of $node->content.

it looks weird to have a pager in an RSS item in a reader... how can I keep it from showing up in nodes that are in the feed?

I thought about changing the pager to be 'in a sidebar block' and then calling the block in manually in the template, but that seems a little hacky.

Comments

elly’s picture

anyone?

celinet’s picture

Have you tried using Contemplate to gain control of your RSS Feed theming?>

elly’s picture

I just write my own templates - is there any control contemplate would give me that writing my own templates doesn't? (and does this mean that there's a rss feed template for nodes that's different than the node template?)

elly’s picture

meh.

no2e’s picture

bump.

gstout’s picture

seriously, No answer still?

gstout’s picture

OK,

The reason the pager is showing up in the RSS feed is the pager is being appended to the $node->content array and then at preprocess time is being imploded back into the $content for display. In The custom pager setup I could not find any way to detect using $node that I was in an RSS viewing op or I would have been able to exclude the display if in the "Pager visibility" "By PHP snippet:" option.

With all my good options gone I figured out this.

Here is a solution.

Switch your custom pager "Pager position: *" for the content type in question to "In a sidebar block" , which will not display anywhere unless you include it somehow. Now you could at the block using what ever method you like. We use Context (one of the greatest modules of all time) at GlobalPost. We could use that to place the block BUT we at GP have a lot going in in our pages so I really needed the pager to be included right after the content var and not in a separate block container. So in the node.tpl.php for the content type I'm paging.
I call this.

 $block = module_invoke('custom_pagers', 'block', 'view', 1);
       print $block['content'];
      

to print the pager block right where I need it.

Again since the pager is now only in a block It will not show up in my RSS feed. Best of Luck.

brockfanning’s picture

I've gotten around this problem by the checking the node's build_mode attribue. Normal node views have a build_mode of 0, while RSS feed views have a build_mode of 4. In the Pager Visibility / By PHP snippet field for the pager, I've got this code:

// Replace 'article' with the name of your content type
if ($node->type == 'article' && $node->build_mode == 0) {
  return TRUE;
}
return FALSE;