Results 1 to 3 of 3

Thread: sorting by ...

  1. #1
    User
    Join Date
    05-02-10.
    Posts
    121

    Default sorting by ...

    Code:
    $GLOBALS['TL_DCA']['tl_content']['list']['sorting']['mode'] = 2;
    $GLOBALS['TL_DCA']['tl_content']['list']['sorting']['fields'] = array('pid');
    how get article title by pid ?
    and insert it in sorting field

    thanks
    sorry for my english

  2. #2
    User
    Join Date
    05-02-10.
    Posts
    121

    Default Re: sorting by ...

    Code:
    $GLOBALS['TL_DCA']['tl_content']['list']['sorting']['fields'] = array('(SELECT title FROM tl_article WHERE tl_article.id=tl.content.pid)');
    this not work...

    because full query

    Code:
    SELECT * FROM tl_content ORDER BY (SELECT title FROM tl_article WHERE tl_article.id=tl.content.pid) LIMIT 0,150)
    sorry for my english

  3. #3
    User
    Join Date
    09-02-10.
    Location
    Banja Luka, Bosnia and Herzegovina
    Posts
    59

    Default Re: sorting by ...

    Code:
    SELECT * FROM table ORDER BY expression ASC
    or DESC for descending...

    You also forgot one ")"

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
  •