Syndicating a Mambo Blog
The final step in setting up Mambo as a blog is to syndicate your blog's content. Syndication through an RSS feed is an easy way to make your content publishable on a lot of websites. It is a win-win scenario, since the site that publishes your feed gets regular fresh content. This means that they can offer fresh content to visitors, and search engne spiders also love new content, which means that their sites will get spidered more often!
If you syndicate your content it means that you win since your content is now visible to more eyes and you will get more visitors to your site.
Mambo does offer site syndication as a built in functionality, however, only for the items on the front page. This is not really what I wanted. I did some scratching around on two of the big Mambo forums (www.mambers.com and forum.mamboserver.com) and found some other people looking for the same thing. There were no easy solutions however and in the end I had to make some code modifications.
This is what I did to get a RSS feed of my Mambo blog...
I had to change the code of the RSS component. Because I have a specific requirement (only to syndicate my blog 'section') at this stage, I did not bother to make it a more generic solution, but I have already thought of how to do it should the need arise.
For a more generic solution one way of doing it would be to create a new RSS module as well as a new RSS component for each different type of feed that one wants to do.
In my case, I just changed the following code in the rss.php file (this file is the main component file for creating your RSS feed and is located in your main Mambo installation directory, under /components/com_rss
At around line 180 I just changed the following code from:
$join = "\n INNER JOIN #__content_frontpage AS f ON f.content_id = a.id";
$and = '';
$and = '';
to
$join = '';
$and = "\n AND a.sectionid = 5";
$and = "\n AND a.sectionid = 5";
where the section ID is the ID of the blog section that I created in Mambo.
Please remember that if you want to do this yourself you need to go into your MySQL database and check which section ID is allocation to your 'blog' section
When I first tried this it didn't want to work and I got an XML error. After some digging and debugging I found that the query string that is built up can do the ORDER BY according to a setting called 'frontpage order', which it refers to as f.ordering', where f here is the frontpage content table that I had just commented out. I went back to my Mambo administration panel, to my Syndication component parameters and changed my order to 'Most recent first'. This uses the main content table date to do the ordering and therefore does not try to refer to the frontpage ordering any more.
I updated my module settings to only make my mod_rss visible on the blog page and there you have it - my blog is now syndicated.
| < Prev | Next > |
|---|
