- Posts: 7
COMMUNITY FORUM
"Add new item in this category" does not work
- Paul de Valmency
- Topic Author
- Offline
- New Member
Great extension!
When logged in, the category view displays a very handy button at the top, labelled "Add a new item in this category", but it doesn't appear to do what I had expected it to.
When I click it, no matter which category or sub-category I'm in, the add form displays a list of ALL categories that I can add to, when I was expecting it to be limited to the category that I'm currently adding to (and it's sub-categories, if any).
E.g. I have a dealers listing, so have a Dealers category with a number of sub-categories representing the countries that they operate in.
When on the main Dealers list, I would expect the button to restrict the categpry selection to ust the Dealers category and all of the sub-categores for it (countries).
When on a specific country listing within the Dealer section, I would expect the add form to restrict the category selection to just the current category (i.e. country).
Is there a way to do this? If not, could this be considered for a future version please?
Cheers,
Paul.
Please Log in or Create an account to join the conversation.
- Lefteris
- Offline
- Moderator
- Posts: 8743
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Paul de Valmency
- Topic Author
- Offline
- New Member
- Posts: 7
Sorry, but no, user permissions are not the answer here as I want the user group to be able to post in a variety of categories.
From what you are saying, the label 'Add a new item in THIS category' is misleading as it implies that clicking on the button will restrict the adding of a new item to THIS category (or one of its sub-categories).
It would be much better for the K2 form to limit the dropdown to just the current category and its sub-categories (if there are any), This would, in my opinion, be very useful and I'm surprised that no-one has mentioned it until now (I did a search and couldn't find any reference to this issue).
Could you review this and think about adding this feature to the K2 form please?
Cheers,
Paul.
Please Log in or Create an account to join the conversation.
- Lefteris
- Offline
- Moderator
- Posts: 8743
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- william white
- Offline
- Platinum Member
- Posts: 3722
catid option:disabled {
display:none;
}
Please Log in or Create an account to join the conversation.
- Paul de Valmency
- Topic Author
- Offline
- New Member
- Posts: 7
Lefteris Kavadas wrote: This is how it works for now. User will see the categories disabled if he cannot add items there. Thanks for your recommendations.
Thanks Lefteris, but unfortunately, the user is authorised to add items to all of the categories displayed.
Judging from the interest in this particular thread, I think that quite a few others are interested in seeing how this works change, so it would be greatly appreciated if you could review this sometime soon.
Regards,
Paul.
Please Log in or Create an account to join the conversation.
- Paul de Valmency
- Topic Author
- Offline
- New Member
- Posts: 7
William White wrote: @paul you might try creating a css rule like this
catid option:disabled {
display:none;
}
Thanks for the suggestion Willian, but as I've posted above, the users are authorised to all of the categories, so it's not a matter of hiding those they aren't authorised to.
The button should either have it's label changed, or the form should really do what the button is suggesting and only contain the current category (and possibly those categories that are subordinate to the current one).
i hope this is looked into soon, because this issue makes using the default K2 form rather a non-starter for me.
Please Log in or Create an account to join the conversation.
- Emilio Alfredo Lodigiani
- Offline
- New Member
- Posts: 1
You can fix it editing the file category.php
the file is in
components/com_k2/templates/default
templates/YOURTEMPLATE/html/com_k2/default
you can change line 46 (in k2 version 2.5.7)
from original
<a class="modal" rel="{handler:'iframe',size:{x:990,y:650}}" href="<?php echo $this->addLink; ?>">
<a class="modal" rel="{handler:'iframe',size:{x:990,y:650}}" href="<?php echo $this->addLink .= '&catid=' . $this->category->id; ?>">
ref:
code.google.com/p/getk2/issues/detail?id=311
code.google.com/p/joomlaworks/issues/detail?id=35
Hope this helps
Please Log in or Create an account to join the conversation.
- Ryan
- Offline
- New Member
- Posts: 3
It worked perfectly for me.
I had the same issue along with the modal box's position being too far to one side cropping a part of the editor. I decided to move away from the modal box and use a new window so I made the following adjustments.
<a onclick="window.open(this.href,'targetWindow','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes');return false;" href="<?php echo $this->addLink .= '&catid=' . $this->category->id; ?>">
Please Log in or Create an account to join the conversation.