Keyword

Show only authorized categories in add item form

  • Nektarios
  • Nektarios's Avatar Topic Author
  • Offline
  • New Member
More
7 years 2 weeks ago #161339 by Nektarios
Hi.

I don't want the users from a specific usergroup to be able to view all categories when adding a new item. I know the ones that they are not allowed to post to that they are disabled but I need them to be removed from the list.

Is this possible?

Thank you.

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

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
7 years 2 weeks ago #161351 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic Show only authorized categories in add item form
Hi Nektarios,

As a quick solution, you can remove the disabled categories with jQuery.
Add this jQuery to the itemform.php file

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 2 weeks ago #161374 by Krikor Boghossian
Replied by Krikor Boghossian on topic Show only authorized categories in add item form
CSS can work as well but not in all browsers.
eg: 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.

  • Nektarios
  • Nektarios's Avatar Topic Author
  • Offline
  • New Member
More
6 years 11 months ago #161596 by Nektarios
Replied by Nektarios on topic Show only authorized categories in add item form
Thank you for your answers.

I cannot see the jquery posted above for some reason but I have managed to my own.

Here it is for anyone interested:
	jQuery(document).ready(function() {
		$('select option').each(function() {
		   var thisAttr = $(this).attr('disabled');
		   if(thisAttr == "disabled") {
		      $(this).hide();
		   }
		});
	});

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
6 years 11 months ago #161603 by Krikor Boghossian
Replied by Krikor Boghossian on topic Show only authorized categories in add item form
Nice one :)

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