I wrote a UDP for a problem I had and just finished the solution (partly). I'd like to share this with you. Hopefully it can be of any good for someone of you.
Problem:
======
I basically wanted a blog functionality based on regular content pages with categories. So I needed a plugin and page structure that allows me to have catgeories and articles. I also wanted a RSS feed

I checked the news module but didn't like the cryptic URLS. Ok, I could have gone for rewrite rules. But considering the overall structure of the news module (maintenance of articles and content options), I thought it would be nice to export regular pages as RSS (and expand with further functions). I couldn't find anything matching.
Solution:
======
This UDP provides the RSS functionality (see next section for implementation). For the blog landing page (and browsing) I still need to extent the options and functionality a bit, but the central issues are solved. It works with my templates which have a few content blocks more (see attachements for template structures). For the category pages (showing sub contents), I plan to re-use parts of this UDP (http://forum.cmsmadesimple.org/index.php/topic,14722.html).
I came up with the attached user defined plug-in. It aims at my own site and structure, so if you'd like to use this code without modification, you need some preparation (at the moment you need the category pages if you'd like to have categories in your feed).
My site structure for this solution is as follows. It will easily allow me to maintain the articles:
+ blog home (tmp01, will contain the landing page option)
| |
| +--- site category (tmp02, only contains catgeory name and one content block)
| | |
| | +--- blog article (tmp03, contains article and extra fields)
| | +--- blog article (tmp03, contains article and extra fields)
| |
| +--- blog category ...
|
+ other main content categories (no blog) with subpages (tmpxx)
|
+ metacontent (section header)
|
+--- RSS (blank code template)
Implementation:
===========
The UDP is placed in a "blank code page", which template only contains the following code and nothing else:
Code: Select all
{content contenttype='application/rss+xml' block="content_en" wysiwyg="false"}
Then add the UDT-code from the attachement (content2rss_01.txt) as a UDT "content2rss" to your CMS. Place plug in call {content2rss...} in a page created with "blank code template". Use parameters as decribed in the code.
To build up a structure with categories, have a look at the simplified templates in the attachement "templates.txt".
=========
Please let me know what you think of that and the blog idea. I know it is not the smoothest code as of now, some things could surely be done more efficiently. I am still working on this one, so I am happy for every input I can get.
Best regards
NH