Keyword

Category dropdown list in front-end content editor is too large because display unused categories

More
14 years 6 months ago #80378 by Vasyl
K2 2.2
Usergrop "A" assigned to add content in one category of 50.
User (included to "A") just click "Add content" on front-end and seen page to add item. On this page is placing dropdown list to select category of content. So, in this dropdown list user can see all categories, but categories not assigned to access user are not active (disabled). If you have a lot of categories, this list is looking dead. I like to hide disabled categories from this list, but this require to change K2 code. Also, this feature is possible to make customazible.

Best regards,
Vasyl

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

More
14 years 6 months ago #80379 by Lefteris
Hi. We chose to display all the category tree so the user can see the structure. Also, not showing the whole category structure may confuse when there are categories with same name.

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

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

More
14 years 6 months ago #80380 by Vasyl
Ok, you are right. But sometimes (and on my project in particular) is necessary to hide unused categories to inprove user comfortableness. Can I choose this by myself, optionally, in categories settings for example?
This question most like Feature requests, please move topic to this section, if it is necessary.
Thanks.

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

More
14 years 4 months ago #80381 by datshay
GOod question Vasyl,
I also have got the same problem. I just wanna display only the sub categories if active category as in Joomla default. It really creates my site look awkward and is difficult for the users to chose the menu...

Thanks,
Datshay

Vasyl said:Ok, you are right. But sometimes (and on my project in particular) is necessary to hide unused categories to inprove user comfortableness. Can I choose this by myself, optionally, in categories settings for example?This question most like Feature requests, please move topic to this section, if it is necessary.Thanks.

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

More
14 years 4 months ago #80382 by scyllar
I need this HIDE DISABLED CATEGORIES thing urgently because I have got a very large list most of which the end users are not accessible. I wouldn't mind giving it a hack but for days I just can't find any clues. Can anyone give me some tips? thanks :)

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

More
14 years 4 months ago #80383 by datshay
Hay please anyone ! i really need it.... urgently.....

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

More
13 years 11 months ago #80384 by Marios Katsis
I find a solution to your problem, but for now you can see it only at Firefox.

You must go at http://yoursite/components/com_k2/views/item/tmpl/form.php and add this

var disabledOptions=$$('#catid option[disabled]');
$each(disabledOptions, function(option){
option.setStyle('visibility', 'hidden');
option.setStyle('font-size', '0px');
});

before (or after, it does not matter) the code

if(window.ie){
var disabledOptions=$$('#catid option[disabled]');
$each(disabledOptions, function(option){
option.setStyle('height', '0px');
});
}

I am looking to give a solution for IE, Opera, Chrome

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

More
13 years 11 months ago #80385 by Marios Katsis
The solution is to add the following code to the page http://yoursite/components/com_k2/views/item/tmpl/form.php

var disabledOptions=$$('#catid option[disabled]');
option.remove(option.selectedIndex);
});

This works for all browsers

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

More
13 years 11 months ago #80386 by Jakub Jedynak
Where add to the page ? I added and no change happen :(

IMO it shouldn't work this way.

When you are in category and click New Article button, category should be already choosen (without dropdown at all).


Marios Katsis said:The solution is to add the following code to the page http://yoursite/components/com_k2/views/item/tmpl/form.php var disabledOptions=$$('#catid option[disabled]'); option.remove(option.selectedIndex);
});

This works for all browsers

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

More
13 years 11 months ago #80387 by Marios Katsis
You have to add it, before the code

if(window.ie){
var disabledOptions=$$('#catid option[disabled]');
$each(disabledOptions, function(option){
option.setStyle('height', '0px');
});
}



Qbin2001 said:Where add to the page ? I added and no change happen :(
IMO it shouldn't work this way.

When you are in category and click New Article button, category should be already choosen (without dropdown at all).


Marios Katsis said:The solution is to add the following code to the page http://yoursite/components/com_k2/views/item/tmpl/form.php var disabledOptions=$$('#catid option[disabled]'); option.remove(option.selectedIndex); });

This works for all browsers

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


Powered by Kunena Forum