Keyword

Can't find new items' adding handler

More
10 years 8 months ago #124284 by Alex
Hi, I need to remove choosing category from the items' front-end adding.
It would be great if I could find file handler and remake it to write only one value of category id to the database, but I can't.

Could you tell me where can I find it?
Thanks!

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

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 8 months ago #124285 by Yiota
Replied by Yiota on topic Re: Can't find new items' adding handler
You can limit the category selection to one by assigning that one to the appropriate user group.

Then with css you could try this in order for the disabled categories not to show

/* List option styling => hide disabled category options */
option[disabled='disabled'] { display: none; }

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

More
10 years 8 months ago #124286 by Alex
Replied by Alex on topic Re: Can't find new items' adding handler
I have already done it.
There are only two values: choose category and this category, where users should add new items.

I wanted to add strings like this in handler file:
Log in  or Create an account to join the conversation.

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 8 months ago #124287 by Yiota
Replied by Yiota on topic Re: Can't find new items' adding handler
Do you have specific user groups per category or just one? If you have only one user group with one category restriction then there is no need to add anything. The category field won't have any more categories to choose from but the one you have set.

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

More
10 years 8 months ago #124288 by Alex
Replied by Alex on topic Re: Can't find new items' adding handler
Unfortunately I've got two user groups and 5 items' category.
The first user's group can add items only in one category from front-end, and the second can add items at any needed category.

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

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 8 months ago #124289 by Yiota
Replied by Yiota on topic Re: Can't find new items' adding handler
So what you want is for your first group to not be able to see the other disabled categories from the category selection option?

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

More
10 years 8 months ago #124290 by Alex
Replied by Alex on topic Re: Can't find new items' adding handler
No, it's already done.

I want to delete category selection option from front-end at all. Because from front-end users could add items only for one category.
For this I want to find file where k2 get information from form (title, alias, category, text..) and write it to the database in the k2-item table.
Thanks!

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

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 8 months ago #124291 by Yiota
Replied by Yiota on topic Re: Can't find new items' adding handler
Wouldn't just hide it suffice? Why do you need to completely remove it from the core K2 files and risk a modification of such a kind?

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

More
10 years 8 months ago #124292 by Alex
Replied by Alex on topic Re: Can't find new items' adding handler
It's not need. It's work fine with hiding now
It's just be better for my site if there wouldn't be such option on front-end adding.

Ok, I understand your position, not to edit k2 core. Maybe you are right!
Thanks, will try to find this file myself.

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

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 8 months ago #124293 by Yiota
Replied by Yiota on topic Re: Can't find new items' adding handler
The file you can modify and keep in your template overrides is the itemform.php file.

If you are already in use of K2 template overrides it should be located in templates/your_template/html/com_k2/default/ folder path. If you do not use template overrides you first have to create some by copying the contents of the path components/com_k2/templates/ to your template folder in the path tempates/your_template/com_k2.

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