Results 1 to 4 of 4

Thread: Sort articles in category by Creation Date

  1. #1
    New user
    Join Date
    02-18-10.
    Location
    Greece
    Posts
    16

    Default Sort articles in category by Creation Date

    hello,

    I can move up and down articles in category but how can i list articles when i
    hit url: http://www.mysite.com/index.php/category_alias.html by Creation Date?

    thanks for any help

  2. #2
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: Sort articles in category by Creation Date

    Contao doesn't use categories, and also articles are not stored in categories, but on pages. huh?

  3. #3
    Community-Moderator
    Join Date
    06-10-09.
    Location
    Bad Segeberg, Germany
    Posts
    16

    Default Re: Sort articles in category by Creation Date

    there is a german extension called Artikelfilter in the german Repository. Maybe its helpfull in case you understand the german language

    -> http://www.contao.org/erweiterungsliste ... 09.de.html

  4. #4
    New user
    Join Date
    02-18-10.
    Location
    Greece
    Posts
    16

    Default Re: Sort articles in category by Creation Date

    thyon: yes i wanted to say 'pages' not 'categories'
    stefan-at-work:thanks i will try the module


    For a quick fix i modified the core code(not so good for upgrades)

    system/libraries/Controller.php Line:208
    (MODIFIED):$objArticles = $this->Database->prepare("SELECT id FROM tl_article WHERE pid=? AND inColumn=?" . (!BE_USER_LOGGED_IN ? " AND (start='' OR start<$time) AND (stop='' OR stop>$time) AND published=1" : "") . " ORDER BY ". $GLOBALS['TL_CONFIG']['articleSortingBy'] ." ".$GLOBALS['TL_CONFIG']['articleSorting'])
    ->execute($objPage->id, $strColumn);

    system.config/config.php
    (ADDED):$GLOBALS['TL_CONFIG']['articleSortingBy'] = 'tstamp'; //sorting,tstamp
    (ADDED):$GLOBALS['TL_CONFIG']['articleSorting'] = 'DESC'; //ASC, DESC

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •