Keyword

Cascading Dropdown for k2 categories in Administra

  • behzad
  • behzad's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 7 months ago #124690 by behzad
I want to show k2 category list in back-end and front-end item editting like this:

select main category : category1 - category2 and... and if user select category1 then appear another dropdown that shows subcategories of category1

I found the files :

I believe this is the code that is producing the category drop down: .../components/com_k2/views/item/tmpl/form.php

<tr>
<td align="right" class="key"><?php echo JText::_('Category'); ?></td>
<td><?php echo $this->lists; ?></td>
</tr>

Please Log in or Create an account to join the conversation.

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 7 months ago #124691 by Yiota
For the frontend the file is itemform.php and can be overriden in your template folder.

For the backend is a little more complicated than that. The file is administrator/components/views/item/view.html.php and the code for the category select list is around line 385

Modifying core files is not recommended, however.

Please Log in or Create an account to join the conversation.

  • behzad
  • behzad's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 7 months ago #124692 by behzad
thanks for your reply , thanks GOD!!!! :)
in itemform.php , I found this :
<?php echo $this->lists; ?>
how can I edit this as I said in last post?

Please Log in or Create an account to join the conversation.

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 7 months ago #124693 by Yiota
I'm afraid that I don't know the answer to that because I'm not a programmer.

You can however seek other developers in this forum that are willing to help you with this as a custom work.

Please Log in or Create an account to join the conversation.

  • behzad
  • behzad's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 7 months ago #124694 by behzad
I don't have any problem with custom work! so if anyone can do this , I pay him or her! but there is a small problem that is : I'm living in Iran and how can I pay?!!!

Please Log in or Create an account to join the conversation.

  • behzad
  • behzad's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 7 months ago #124695 by behzad
Hi,
I did this , but my problem now is when I select category always load on of the extrafields group , how can I solve it?

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum