0
Welcome Guest! Login
0 items Join Now

J17 Sorting Articles by Category to see Sub Categories

    • JoomGO's Avatar
    • JoomGO
    • Sr. Rocketeer
    • Posts: 212
    • Thanks: 0
    • Web Media Developer

    J17 Sorting Articles by Category to see Sub Categories

    Posted 13 years 4 months ago
    • In Joomla 1.7 I have a blog with sub categories. In Article Manager is there a way to sort by a category and see the articles in that category along with all the articles in its sub categories?
    • Website Design & Management
      This email address is being protected from spambots. You need JavaScript enabled to view it. | http://www.joomgo.com
    • Andy Miller's Avatar
    • Andy Miller
    • Preeminent Rocketeer
    • Posts: 9919
    • Thanks: 96
    • Web Kahuna

    Re: J17 Sorting Articles by Category to see Sub Categories

    Posted 13 years 4 months ago
    • If it works in the default Joomla 1.7 admin template, then yes, else no :) Basically the admin template doesn't control the functionality of the extensions (such as article manager) at all, merely uses some CSS to style them.
    • JoomGO's Avatar
    • JoomGO
    • Sr. Rocketeer
    • Posts: 212
    • Thanks: 0
    • Web Media Developer

    Re: J17 Sorting Articles by Category to see Sub Categories

    Posted 13 years 4 months ago
    • Yea I probably shouldn't have posted this in the Mission Control forum. This is more of a general question for Joomla 1.7

      I have a category setup as Blog with 4 subcategories under it. When you are in article manager and sort the articles by category and select the parent category, Blog - ONLY articles in Blog shows, not all the subcategory articles which is annoying.
    • Website Design & Management
      This email address is being protected from spambots. You need JavaScript enabled to view it. | http://www.joomgo.com
    • JoomGO's Avatar
    • JoomGO
    • Sr. Rocketeer
    • Posts: 212
    • Thanks: 0
    • Web Media Developer

    Re: J17 Sorting Articles by Category to see Sub Categories

    Posted 13 years 4 months ago
    • Next time I'll do a better job of searching before asking :)

      Here is how you do it:
      forum.joomla.org/viewtopic.php?p=2687079
      The code is in administrator\components\com_content\models\articles.php line 190.
      Filter on the path column and it will show articles in all sub categories.
      // Filter by a single or group of categories.
             $categoryId = $this->getState('filter.category_id');
             if (is_numeric($categoryId)) {
                 $query->where('c.path like (select concat(path,"%") from #__categories where id='.(int) $categoryId.')');
             }

      Replace line 190 in articles.php with the above line:
      $query->where('c.path like (select concat(path,"%") from #__categories where id='.(int)

      ... and everything works great!
      Now category show articles in all sub-categories!
    • Website Design & Management
      This email address is being protected from spambots. You need JavaScript enabled to view it. | http://www.joomgo.com

Time to create page: 0.052 seconds