# Need help with categories in Typo

**URL:** <https://www.ruby-forum.com/t/need-help-with-categories-in-typo/104487>\
**Category:** Rails\
**Created:** [May 18, 2007, 4:57pm UTC](https://www.ruby-forum.com/t/need-help-with-categories-in-typo/104487 "2007-05-18T16:57:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![thereverseengineers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/f07891/32.png) [@thereverseengineers](https://www.ruby-forum.com/u/thereverseengineers)\
**Post date:** [May 18, 2007, 4:57pm UTC](https://www.ruby-forum.com/t/need-help-with-categories-in-typo/104487/1 "2007-05-18T16:57:32Z")

</div>

I’ve upgraded to Typo 4.0 and now have an issue with the Articles  
Controller.

Here’s the issue:

In Typo 2.6.0 I had changed the Articles Controller code like such:

* * *

def category  
if category = Category.find\_by\_permalink(params[:id])  
@articles = Article.find(:all, :conditions =\> [%{ published != 0  
AND articles.id = articles\_categories.article\_id  
AND articles\_categories.category\_id = ? }, category.id],  
:joins =\> ‘, articles\_categories’,  
:order =\> “title ASC”)

```
  @pages = Paginator.new self, @articles.size,

```

config[:limit\_article\_display], @params[:page]  
start = @pages.current.offset  
stop = (@pages.current.next.offset - 1) rescue @articles.size

```
  @articles = @articles.slice(start..stop)
  render :action => "index"
else
  error("Can't find posts in category #{params[:id]}")
end

```

## end

Basically I wanted the category hyperlinks in the sidebar to return  
the results in alphabetical order ( I ordered them with “title ASC”).  
A-Z instead of reverse chronological order.

This worked great but in the new Typo 4.0, the code for categories has  
drastically changed, now it is as follows:

* * *

## def category render\_grouping(Category) end

It goes through a series of steps before rendering the index.

I’m kind of a newbie Ruby coder. Any thoughts on how to alphabetize  
category results in Typo 4.0?

Any help will be greatly appreciated.

thanks,

Dan
