Recent Topics

Only including the auto discovery links if required

Started by on Feb 06, 2009 – Contents updated: Feb 06, 2009

Feb 06, 2009 13:23    

Hi

When 'no feed' is selected for a particular blog, b2evo correctly provides no feeds if the rss or atom urls are accessed. However, the skins are unaware that 'no feed' has been selected and still displays the auto discovery links. Below is the solution from the support forum:

In your skin replace:

<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php $Blog->disp( 'rss2_url', 'raw' ) ?>" />
<link rel="alternate" type="application/atom+xml" title="Atom" href="<?php $Blog->disp( 'atom_url', 'raw' ) ?>" />

with :

<?php $feed_content = $Blog->get_setting('feed_content'); 
	if( $feed_content != 'none' ) { ?>
		<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php $Blog->disp( 'rss2_url', 'raw' ) ?>" />
		<link rel="alternate" type="application/atom+xml" title="Atom" href="<?php $Blog->disp( 'atom_url', 'raw' ) ?>" />
	<?php } ?>

Cheers
Lee

Feb 07, 2009 15:44

Fixed in 3.x thanks ;)

¥

Feb 07, 2009 16:11

Wow, excellent :D

Thanks

Feb 09, 2009 19:52

Might make more sense to have a method in the Blog class like "get_feed_headlines()" and just use that in the skins (with "echo"/"implode").
The logic, if (and which) lines should get returned, would be done there.
This would also provide a more central place to add other feed formats later.


Form is loading...

Social CMS – This forum is powered by b2evolution CMS, a complete engine for your website.