Skip to main content
  Thursday, October 25 2018
  4 Replies
  837 Visits
  Subscribe
I'm using My Maps Location whit K2 Items. Is it possible to view only children category in the category selct field?
I.e.
I've got the following tree structure

Category 1
--- Subcategory 1.1
--- Subcategory 1.2
--- Subcategory 1.3
Category 2
--- Subcategory 2.1
--- Subcategory 2.2

Now, in every map in the category select field I can see all categories and subcategories but I want to see only Categoy 1 and its 3 children subcategories.
Thank You
A
5 years ago
Hi,

Thanks for contacting us here about this extension.
I'm using My Maps Location whit K2 Items. Is it possible to view only children category in the category selct field?
I.e.
I've got the following tree structure

Category 1
--- Subcategory 1.1
--- Subcategory 1.2
--- Subcategory 1.3
Category 2
--- Subcategory 2.1
--- Subcategory 2.2

Now, in every map in the category select field I can see all categories and subcategories but I want to see only Categoy 1 and its 3 children subcategories

Yes, you should enable Display category filter parameter in settings. On frontend, you can select Category 1, then you will see what in category 1 can its sub.

Hope it helps!
Cheers,
N
5 years ago
Hi, the problem is that in the select field I can see all K2 categories.
A
5 years ago
Hi,

Thanks for getting back to me with more information.
Please drop us a ticket (menu Support > Ticket support). Our developer in charge will see how he can help you.

Thanks a lot!
Cheers,
A
5 years ago
@Nico1979
if you check the default_form.php there the code is written as $this->k2category whih create the category box.
$this->k2catid=JFactory::getApplication()->input->getInt('k2_catid',$this->extra_catid);

require_once JPATH_ADMINISTRATOR.'/components/com_k2/models/categories.php';
$categoriesModel = K2Model::getInstance('Categories', 'K2Model');
//you can change the code here and put your category id
$categories = array_merge(
array('' => JText::_('JOPTION_SELECT_CATEGORY')), $categoriesModel->categoriesTree(NULL, true, false)
);
$this->k2category=JHTML::_('select.genericlist', $categories, 'k2_catid', 'class="inputbox"', 'value', 'text', $this->k2catid);
  • Page :
  • 1
There are no replies made for this post yet.