Forum: Ruby on Rails Need help with categories in Typo

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
4e5dfe40df75753346a515a8d1f09568?d=identicon&s=25 thereverseengineers (Guest)
on 2007-05-18 16:57
(Received via mailing list)
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
This topic is locked and can not be replied to.