Designing the MODx Weblog

Posted on 12-Jan-06 at 11:02 pm by Mark Kaplan

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

Folder Structure

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 ;-)

Meta: RSS feed Permalink

Comments:

1
Great work Mark! by OpenGeek 12-Jan-06 11:38 PM
It looks good, and is very usable. Let's get blogging!
2
cool! by MadeMyDay 13-Jan-06 02:55 AM
This is a cool approach!

Ever thought about kind of trackback/pingback features?
3
cool! by MadeMyDay 13-Jan-06 02:57 AM
This is a cool approach!

Ever thought about kind of trackback/pingback features?
4
nice! by g5604 13-Jan-06 03:39 AM
cant wait for the full tutorial :-)
5
Awesome! by wendy 13-Jan-06 08:20 AM
Nice thing to know that we have a blog for MODx now.
6
I just love it ! by davidm 14-Jan-06 09:51 AM
One of the things that still amazes me is how fast ideas become true with MODx projects. It's a real testimony about flexibility !

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 ?
7
Not quite yet! by Mark 14-Jan-06 01:53 PM
Not quite yet David. MODxCMS.com is still running an unreleased bit of code.
8
how? by edipo 31-Jan-06 08:45 AM
How I can do this exaclty? I'm very interested and I'm a newbie...
9
Stay tuned! by Mark 31-Jan-06 10:00 AM
edipo, stay tuned... in another week or so I plan to post article #2 (I have finals week).
10
oh yes by edipo 31-Jan-06 02:00 PM
I will stay ;-)
11
news? by edipo 10-Mar-06 08:58 AM
any news? ;-P

You must be logged into the forums to comment. Please login