Keyword

"Add new item in this category" does not work

  • Paul de Valmency
  • Paul de Valmency's Avatar Topic Author
  • Offline
  • New Member
More
12 years 3 weeks ago #103381 by Paul de Valmency
"Add new item in this category" does not work was created by Paul de Valmency
Hi guys,

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.

More
12 years 3 weeks ago #103382 by Lefteris
Hi. You may need to take a look at the K2 user groups. Give the desired group the permission only for the category you want. Other categories will still appear on the form but the user will have no permissions to use them.

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
  • Paul de Valmency's Avatar Topic Author
  • Offline
  • New Member
More
12 years 3 weeks ago #103383 by Paul de Valmency
Replied by Paul de Valmency on topic Re: "Add new item in this category" does not work
Hi Lefteris,

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.

More
12 years 3 weeks ago #103384 by Lefteris
This is how it works for now. User will see the categories disabled if he cannot add items there. Thanks for your recommendations.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

More
12 years 3 weeks ago #103385 by william white
Replied by william white on topic Re: "Add new item in this category" does not work
@paul you might try creating a css rule like this
catid option:disabled {
display:none;

}

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

  • Paul de Valmency
  • Paul de Valmency's Avatar Topic Author
  • Offline
  • New Member
More
12 years 2 weeks ago #103386 by Paul de Valmency
Replied by Paul de Valmency on topic Re: "Add new item in this category" does not work

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
  • Paul de Valmency's Avatar Topic Author
  • Offline
  • New Member
More
12 years 2 weeks ago #103387 by Paul de Valmency
Replied by Paul de Valmency on topic Re: "Add new item in this category" does not work

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
  • Emilio Alfredo Lodigiani's Avatar
  • Offline
  • New Member
More
12 years 1 week ago - 12 years 1 week ago #103388 by Emilio Alfredo Lodigiani
Replied by Emilio Alfredo Lodigiani on topic Re: "Add new item in this category" does not work
The problem appears to be a bug. The button to post an item in current category should open the edit form with the current category preselected. Instead it has the standard behaviour, as the new item button.

You can fix it editing the file category.php
the file is in
components/com_k2/templates/default
or, if you are using a template override in
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; ?>">
to
<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.

More
11 years 2 weeks ago #103389 by Ryan
Thanks Emilio,

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.


Powered by Kunena Forum