Designing the MODx Weblog
A few days ago Ryan and I were chatting and one of us mentioned how MODxCMS.com needed a news section. Over the course of that discussion we mapped out our ideas and eventually decided to create a development blog. Guess who got called in to make it work?
Compared to Jason, Adam, and Raymond, I’m no PHP coder but I do just fine with NewsListing (albeit with a little help sometimes). So, I decided to push myself and take on the entire blog’s backend. I came up with a plan which had a few key ideas:
- Everyone’s posts would appear on the main index even though they were to be in different folders
- To comment, users would be able to use their forum accounts and their avatars, names, and profiles would automatically be used
- Comment counts would appear when posts were listed just like in traditional blogs
- The RSS feed would be set up so that only one document would generate both the main rss feed and each authors own feed

All of these ideas were bold in that none have been done before in MODx. To get things started I created this clean folder structure (see the image on the right).
Once I set that up I created a complex NewsListing call that is used on the main blog page that gets all of an authors posts without the parent folder or child documents (comments) appearing.
[[nl? &startID=`254` &tpl=`nl_blog_tpl` &summarize=`5` &commentschunk=`FormBlogComments` &paginate=`1` &dateformat=`%d-%b-%y` &alwaysshow=`1` &truncText=`Read more...` &multilevel=`1` &filter=`hidemenu, 0|parent, 254,2` ]]
I wasn’t kidding! That’s one big call! After that, I put together each author’s page and a basic blog was born. The next thing in my crosshairs was the user comments. I had tried earlier to integrate SMF’s SSI with MODx and had run into trouble, but I was determined this time. I brought in Jason and within minutes we found the problem--- with SMF! For some reason the folks coding SMF decided that they wanted to use a PHP function which tries to set a session without checking if one exists! A quick one line fix later and I was rolling. I looked up code for how to get the info I wanted and set off. An hour later it was done. SMF integrated User Comments was complete! Don’t worry, I’ll share the code!
As for how the rest was done, you’ll have to wait until my next post ;-)
Comments:
Ever thought about kind of trackback/pingback features?
Ever thought about kind of trackback/pingback features?
I must say NewsListing is a great piece of work, so thanks Mark :) I've used it for two websites, and it's so good I'll even use it for my own blog !
One thing about this example : I notice you use 0|parent as a filter parameter. Does that mean you can use multiple filter criterias with a pipe as a separation ?
You must be logged into the forums to comment. Please login