dimitrisscript
dimitrisscript

Reputation: 1

Joomla remove one of the two feeds

My joomla version is 2.5, not sure if this happens with Joomla 3 too.

I have these 2 lines of HTML generated in the page where I have a "category blog":

<link href="/blog?format=feed&amp;type=rss" rel="alternate" type="application/rss+xml" title="RSS 2.0">
<link href="/blog?format=feed&amp;type=atom" rel="alternate" type="application/atom+xml" title="Atom 1.0">

Now, these lines can be disabled by going to Menus > menu item name > advanced parameters > Show a Feed Link - No.

However, there is no option to disable just ONE of them (preferably Atom). This is what i'm looking for! I've found many tutorials that explain how to disable both of them.

Any ideas on how to disable just one of the two?

Upvotes: 0

Views: 1505

Answers (4)

Bhojendra Rauniyar
Bhojendra Rauniyar

Reputation: 85545

You can remove those feeds from your template's index.php:

$this->_links = array(); // To remove both feeds
array_splice($this->_links, 0, 1); // To remove only RSS Feed
array_splice($this->_links, 1); // To remove only Atom Feed

Upvotes: 1

dimitrisscript
dimitrisscript

Reputation: 1

Ok thanks to Amruth Rao, here's how I did it:

In this file around line 105:

/libraries/joomla/document/html/renderer/head.php

change from:

foreach ($document->_links as $link => $linkAtrr)
        {
            $buffer .= $tab . '<link href="' . $link . '" ' . $linkAtrr['relType'] . '="' . $linkAtrr['relation'] . '"';
            if ($temp = JArrayHelper::toString($linkAtrr['attribs']))
            {
                $buffer .= ' ' . $temp;
            }
            $buffer .= ' />' . $lnEnd;
        }

to:

$buffer .= '<link href="/blog?format=feed&amp;type=rss" rel="alternate" type="application/rss+xml" title="RSS 2.0">';
$buffer .= '<link href="/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon">';

or if you want to keep atom instead:

$buffer .= '<link href="/blog?format=feed&amp;type=atom" rel="alternate" type="application/atom+xml" title="Atom 1.0">';
$buffer .= '<link href="/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon">';

Take care though, the Joomla installation on which i tried it, was heavily customized, so perhaps you need to include more declarations inside the $buffer variable.

Unfortunately you will have to make these changes each time you update your Joomla, but this is the easiest way I've found to do this.

Upvotes: 0

Angular Learner
Angular Learner

Reputation: 390

If you want to remove only of them(Atom feed) then it includes two cases:

1) To remove it from the core library file which is under

test_joomla/libraries/joomla/document/feed/renderer/atom.php

This file includes the feed line in the header , but this is not a preferred one as your about to change the core files if in future if you update you version then you need redo the changes again.

2) To remove the jhead from template file, this one is main line which includes the mootools js , css and feeds in the header.Once you remove those then you need to include them manually in your template file but that's a hectic one.

Hope this one helps you.

Upvotes: 1

Toretto
Toretto

Reputation: 4711

To Remove Both or any one of them here is the article by which you can disable or enable feed and atom i n Joomla.

Reference Url : http://www.host1plus.com/tutorials/cms-tutorials/joomla/other-joomla/how-to-turn-off-rss-atom-feeds-in-joomla-2-5/

You can also use the same way to disable/enable in Joomla 3 as well.

Hope this will help you.

Upvotes: 0

Related Questions