WilliamWhiteJr.com

Switch to desktop Register Login

How to disable unused categories in Front End Editing

Create a rule in your css file that will stop the display of disabled category's

#catid option:disabled {
display:none;

}

 

You can also do it like this

You can do it like this :

- Override the core K2 item form layout by copying the file 'components/com_k2/views/item/tmpl/form.php' to 'templates/YOURJOOMLATEMPLATE/html/com_k2/item/form.php'
- Edit this new file and add this js code to it (in 2.4.1, i've added this in line 208, just before the end of the K2 js part) :

window.addEvent('
domready',function () {
$$('
#catid option').each(function(item, index){
if (item.getProperty('disabled'))
item.remove();
});
});

I've just tested on a local website with Joomla! 1.5.20, K2 v2.4.1 and mootools 1.1/1.2

For K2 Latest Version try
<script type="text/javascript">
window.addEvent('domready',function () {

$K2('#catid option[disabled="disabled"]').remove();

});
</script>