Keyword

SOLVED: Hide category options

  • Jeroen
  • Jeroen's Avatar Topic Author
  • Offline
  • New Member
More
12 years 1 week ago - 12 years 1 week ago #103896 by Jeroen
SOLVED: Hide category options was created by Jeroen
Hi all,

I am trying to maken the K2-experience as smooth as possible for my users. I am stuck on two things, however. I have a rather big ACL set up on my site. I have many groups that a user can belong to and an even bigger list of categories that he can or can not view. I would like to hide the options for the user that he has no use of:

1) Hide the non relevant categories when editing or making an article

I found that it should be rather easy to hide the categories that are not relevant for the user. K2 already greys them out, adding a little on that and they are hidden. It looks like this:
<option disabled="disabled" value="32" style="color: rgb(128, 128, 128);">Option 1</option>

Where does K2 do this, what file do I need to edit to add here the code?
style="display: none;"

2) Hide the non-relevant access levels

This one is going to be more complicated. I was hoping to find a plugin to do this. The user can now choose from the massive list of ACL I have and they sometimes end up with the wrong ACL and can then neither view nor edit their own work again. How could I let them only select acces levels that they have access to?

I hope someone can help me with these questions.
Greetings!

Jeroen

Solved question 1, see last post.

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

More
12 years 1 week ago #103897 by Lefteris
Replied by Lefteris on topic Re: Hide category options and accesslevels
Hi. If you are not a programmer, the easiest way to do this is to add some CSS rules to hide what you want ot hide.

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

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

  • Jeroen
  • Jeroen's Avatar Topic Author
  • Offline
  • New Member
More
12 years 1 week ago #103898 by Jeroen
Replied by Jeroen on topic Re: Hide category options and accesslevels
Any suggestions on how to do that? There is no id or name to link to.

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

More
12 years 1 week ago #103899 by Lefteris
Replied by Lefteris on topic Re: Hide category options and accesslevels
Search this forum i think that someone has already posted the CSS code needed. Or search Google about how you can style disabled elements.

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

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

  • Jeroen
  • Jeroen's Avatar Topic Author
  • Offline
  • New Member
More
12 years 1 week ago #103900 by Jeroen
Replied by Jeroen on topic Re: Hide category options and accesslevels
Hi Lefteris,

Could you point me to the post about that, I can not find it. I tried Google and came up with this:
/* Input styling => hide disabled input */
option [disabled='disabled'] {display: none;}

This doesn't work, also when I use visibility: none

Any more tips? Really appreciated!
Greetings,

Jeroen

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

More
12 years 1 week ago #103901 by Lefteris
Replied by Lefteris on topic Re: Hide category options and accesslevels
Really you didn't find other results on Google? Anyway try something like that:
option[disabled] { display:none; }

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

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

  • Jeroen
  • Jeroen's Avatar Topic Author
  • Offline
  • New Member
More
12 years 1 week ago #103902 by Jeroen
Replied by Jeroen on topic Re: Hide category options and accesslevels
Ah, how dumb of me not to notice the space there. Anyway, now it works and for those who wonder the same:

Edit the file: [publichtml]/media/k2/assets/css/k2.css

And add to the bottom of that file (just before /* End */):
/* List option styling => hide disabled category options */
option[disabled='disabled'] { display: none; }

Thanks a lot!
Greetings,

Jeroen

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

More
10 years 11 months ago #103903 by Meni
Replied by Meni on topic Re: SOLVED: Hide category options
Hello.
I added this code to the bottom of the [publichtml]/media/k2/assets/css/k2.css
/* List option styling => hide disabled category options */
option[disabled='disabled'] { display: none; }

Everything works good in Firefox and Google Chrome, but in Internet Explorer it does not changed. Does somebody know how to fix it?
Thank you.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 11 months ago #103904 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: SOLVED: Hide category options
Hello Manny,

Using css on these form elemens will not work on every browser, instead you can use a simple jQuery script to remove all the disabled options.

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

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


Powered by Kunena Forum