user2384309
user2384309

Reputation: 1

show item/article list in category tree in joomla k2 module or component

its posibble to get view like this (with module or component) in joomla k2?

  1. parent category 1
    • child category 1.1
      • item 1.1.1
      • item 1.1.2
      • item 1.1.3
    • child category 1.2
      • item 1.2.1
      • item 1.2.2
      • item 1.2.3
    • child category 1.3
      • item 1.3.1
      • item 1.3.2
      • item 1.3.3
  2. parent category 2
    • child category 2.1
      • item 2.1.1
      • item 2.1.2
      • item 2.1.3
    • child category 2.2
      • item 2.2.1
      • item 2.2.3
      • item 2.2.3
    • child category 2.3
      • item 2.3.1
      • item 2.3.2
      • item 2.3.3
  3. parent category 3
    • child category 3.1
      • item 3.1.1
      • item 3.1.2
      • item 3.1.3
    • child category 3.2
      • item 3.2.1
      • item 3.2.2
      • item 3.2.3
    • child category 3.3
      • item 3.3.1
      • item 3.3.2
      • item 3.3.3

what i mean is like this

click to see image

anyone can help? please.. you will save my live :cheer:

Upvotes: 0

Views: 1507

Answers (1)

Rakesh Sharma
Rakesh Sharma

Reputation: 13738

You can use like this example of menus drop down if you want to use for catagories use appropriate tables (for radios use level field of table as main in ul,ol indteadof select ):-

<?php $db = JFactory::getDBO();
      $query = "SELECT m.id, m.title,m.level,mt.menutype FROM #__menu AS m INNER JOIN #__menu_types AS mt ON mt.menutype = m.menutype WHERE mt.menutype = m.menutype AND m.published = '1' ORDER BY mt.menutype,m.level";
      $db->setQuery($query);
      $rows = $db->loadObjectList();?>

      <select id="setredirct" name="settings[]">
        <option value="" selected="selected">---Default---</option>
        <?php foreach ($rows as $row) {?>
        <option value="<?php echo $row->id;?>" >
          <?php echo '<b>'.$row->menutype.'</b>';
          if ($row->level == 1) { echo '-';}
          if($row->level == 2) { echo '--';}
          if($row->level == 3) { echo '---';}
          if($row->level == 4) { echo '----';}
          if($row->level == 5) { echo '-----';}
            echo $row->title;?>
        </option>
      <?php }?>
      </select>

Upvotes: 1

Related Questions