[Problem Solved] RSS Feed based on regular content tree -> content2blog V 0.1

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
Post Reply
nhaack

[Problem Solved] RSS Feed based on regular content tree -> content2blog V 0.1

Post by nhaack »

Hi there,

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"}
To get the contenttype working, you can follow the solution suggested here: http://forum.cmsmadesimple.org/index.php/topic,9190.0.html in this forum for a nice solution (Thanks fredt).

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
Attachments

[The extension txt has been deactivated and can no longer be displayed.]

[The extension txt has been deactivated and can no longer be displayed.]

Last edited by nhaack on Sat Oct 20, 2007 9:37 pm, edited 1 time in total.
carasmo
Power Poster
Power Poster
Posts: 506
Joined: Thu Feb 08, 2007 6:11 pm

Re: [Problem Solved] RSS Feed based on regular content tree -> content2blog V 0.

Post by carasmo »

Brilliant!
nhaack

Re: [Problem Solved] RSS Feed based on regular content tree -> content2blog V 0.

Post by nhaack »

Hi Carasmo,

thank you! Did you try it out? Did it work for you?

Greetings
Nils
carasmo
Power Poster
Power Poster
Posts: 506
Joined: Thu Feb 08, 2007 6:11 pm

Re: [Problem Solved] RSS Feed based on regular content tree -> content2blog V 0.1

Post by carasmo »

Sorry, but this doesn't appear to work in 1.5.2 "Caguas". I followed the instructions and perhaps I'm having a brain fart, but are you available for hire and how much?
Last edited by carasmo on Mon Mar 02, 2009 6:59 pm, edited 1 time in total.
nhaack

Re: [Problem Solved] RSS Feed based on regular content tree -> content2blog V 0.1

Post by nhaack »

Hi carasmo,

quite a late reply ;) ... this UDT evolved into the content_dump plug-in which you can find documented here: http://wiki.cmsmadesimple.org/index.php ... ntent_dump and for download here: http://dev.cmsmadesimple.org/project/files/564

I'll contact you on the rest.

Best
Nils
Post Reply

Return to “Tips and Tricks”