Forum: Ruby on Rails Need help with categories in Typo

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
thereverseengineers (Guest)
on 2007-05-18 18:57
(Received via mailing list)
I've upgraded to Typo 4.0 and now have an issue with the Articles

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_categories.article_id
          AND articles_categories.category_id = ? },],
        :joins => ', articles_categories',
        :order => "title ASC")

      @pages = self, @articles.size,
config[:limit_article_display], @params[:page]
      start = @pages.current.offset
      stop  = ( - 1) rescue @articles.size

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

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

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.


This topic is locked and can not be replied to.