views:

751

answers:

1

I'm trying to get Drupal 6 to reverse the order in which the nodes appear in the frontpage. I'm pretty much using "Story"s as a blog engine and so far it has done it's job pretty well. I'm a bit annoyed though at the fact that nodes are listed in reverse chronological order. I mean, granted, if you want to display multiple node previews in a single page this is the way to go. In my case, I want to display a single full post on the main page and have it be the "last" item on the list (and have the pager act accordingly). I think that works a bit more intuitively since the "first" link should actually point to the first blog post.

So far I've managed to edit "node.module" to show the items in chronological order, the pager is behaving this way as well. What I cant seem to figure out is how to make the default page the "last" one.

Any pointers or ideas very welcome.

+2  A: 

In Drupal, there are many ways to solve any given problem, but typically there are one or two ways that are "best." With Drupal, "best" usually refers either to elegance or convention.

In this case, it's a bit of both. What you want, rather than to modify node.module, is to setup Views. Views is a module that will allow you to filter, sort and arrange not only what appears on the front page of your Drupal site, but basically everywhere else, too.

Start down the rabbit hole by reading this disucssion:

http://drupal.org/node/300919

And then keep the following in mind. With Drupal, you will get the best results if you look for solutions that do not involve changing any of the "core modules" -- the files in your /modules folder. It's best to leave these files alone because they are frequently updated by Drupal security and feature updates, and you don't want to have to replicate your changes by hand 12 times for each release's lifecycle.

Instead, you will often find that a contributed or custom module will do the trick. And there are many ways to manipulate content through preprocessor functions, which you can Google.

I wish you luck in your adventure. It can be discouraging at first, but if you keep working with the system a while, it pays off big time.

andrew b
Thanks for the suggestion. I've been googling for modules or workarounds for this specific issue for days now. I usually wouldn't go messing around with a codebase I really don't understand, I just didn't think I had a choice. I'll take a look at Views and if it works I'll mark you as the answer. Awesome response time, thanks :D
enriquein
Welcome... I was actually looking for an answer to my question and stumbled on yours. :) Changing node order is probably one of the first things that trips up everyone new to Drupal, so you're not alone there. -- ab
andrew b
Views seem pretty nice. I still can't figure out how to tell it to change the default node to the "last" one on the list. I was able to sort the list as I wanted though. Great stuff.
enriquein
Marking you as answer since you led me in the right direction and my current question should be posted (I think) separately as it involves Views and not source code changes (as the title implies). Thanks!
enriquein