How do I select items from some categories in descending order?

21 views
Skip to first unread message

Nelson o mesmo

unread,
Aug 21, 2013, 1:37:22 PM8/21/13
to toron...@googlegroups.com



        Hello!
        How do I select items from some categories in descending order?
       
        // helper.php - Joomla 3.1 - Gantry Framework

        public static function getListForUser($params)
           {
                $db = JFactory::getDbo();

        // Get an instance of the generic articles model
        $model = JModelLegacy::getInstance('Articles', 'ContentModel', array('ignore_request' => true));
        $app = JFactory::getApplication();
               
                // Set the filters based on the module params
        $model->setState('list.start', 0);
        $model->setState('list.limit', 9);
        //$model->setState('list.limit', (int) $params->get('count', 7));
        $model->setState('filter.published', 1);
        $model->setState('filter.featured', 1);
       
        // Show cateries
        $model->setState('filter.catid', array('catid' => 25, 29, 30, 45,);   
       
        // Order by ID
        $model->setState('list.ordering', 'id');
        $model->setState('list.direction', 'DESC');


                      $items = $model->getItems();
                     
                      return $items;
           }

Alan Langford

unread,
Aug 21, 2013, 1:52:07 PM8/21/13
to toron...@googlegroups.com
Hello Nelson. This is the wrong place to ask that question. Based on the Gantry comment, this is probably a question for the RocketTheme forums. You can also try the general development list over at https://groups.google.com/forum/#!forum/joomla-dev-general but they might just tell you to post on rocketTheme as well.

Alan Langford

unread,
Aug 26, 2013, 12:00:11 PM8/26/13
to toron...@googlegroups.com
Nelson, please stop posting coding questions here and use an appropriate forum. If you continue, you'll just get banned.


On Wednesday, August 21, 2013 1:37:22 PM UTC-4, Nelson o mesmo wrote:
Reply all
Reply to author
Forward
0 new messages