Keyword

Frontend Editing - Hide Disabled Categories

  • Rodrigo Moragas
  • Rodrigo Moragas's Avatar Topic Author
  • Offline
  • New Member
More
12 years 7 months ago #62695 by Rodrigo Moragas
Frontend Editing - Hide Disabled Categories was created by Rodrigo Moragas
Hello,

I found a topic for this, but only for the 2.4.1 editing the form.php.

I'm using joomla 1.7 and K2 2.5.4 and the file form.php don't axist anymore. The file that I have found was itenform.php, but I coundn't found the code they talk about.

This is the post I found: community.getk2.org/forum/topics/frontend-editing-hide?commentId=3536014%3AComment%3A57384

I have search this for many days and try lots of combinations with those codes, but I just starting at php.

Thanks in advance.

Rodrigo Moragas

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

  • Rodrigo Moragas
  • Rodrigo Moragas's Avatar Topic Author
  • Offline
  • New Member
More
12 years 7 months ago #62696 by Rodrigo Moragas
Replied by Rodrigo Moragas on topic Re: Frontend Editing - Hide Disabled Categories
Can anyone help, please?

Thanks..

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

  • Rodrigo Moragas
  • Rodrigo Moragas's Avatar Topic Author
  • Offline
  • New Member
More
12 years 7 months ago #62697 by Rodrigo Moragas
Replied by Rodrigo Moragas on topic Re: Frontend Editing - Hide Disabled Categories
Hello,

I search the web trying to find an answer, but without luck.

I talk to some friends to see if they know how to solve this but no could help.

If anyone have this same issue and solve it, please help.

I'm only dependinng on this to finish this project.

Thanks again,

Rodrigo Moragas

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

More
12 years 6 months ago #62698 by Mircea Rusu
Replied by Mircea Rusu on topic Re: Frontend Editing - Hide Disabled Categories
Same problem here, After upgrade k2 to 2.5.5, the file specified in
community.getk2.org/forum/topics/remove-not-assigned-categories-1?commentId=3536014:Comment:85244
is not working

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

More
12 years 6 months ago #62699 by william white
Replied by william white on topic Re: Frontend Editing - Hide Disabled Categories
There may be chages but this code from the old forum for 2.4.1 by Olivier worked for me
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

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

More
12 years 6 months ago #62700 by Mircea Rusu
Replied by Mircea Rusu on topic Re: Frontend Editing - Hide Disabled Categories
Is exactly what i did have on k2.4.1 and was working perfect. Then. Now, after i upgraded k2 to 2.5.5, the override is not overriding anymore.
Is Joomla 1.5.26 with k2 2.5.5 ( just upgraded from 2.4.1)

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

More
12 years 6 months ago #62701 by Mircea Rusu
Replied by Mircea Rusu on topic Re: Frontend Editing - Hide Disabled Categories
Done:

I have edited ..\media\k2\assets\js\k2.js at the line 239 from
$K2('#catid option[disabled]').css('color', '#808080');
to
$K2('#catid option[disabled]').css('font-size', '0px');

not nice but is working on Firefox. Not working on IE9, Chrome, etc.

Still need a solution for this

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

More
12 years 4 months ago #62702 by robm
Done: 

I have edited ..\media\k2\assets\js\k2.js at the line 239 from 
$K2('#catid option[disabled]').css('color', '#808080'); 
to 
$K2('#catid option[disabled]').css('font-size', '0px');

is not a good solutution.

Anyone knows how to hide the disabled categories when adding an article? (disabled = depending on usergroup)

Thanks for your help

Rob

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

More
12 years 3 months ago - 12 years 3 months ago #62703 by robm
Here is my solution.
It now works with IE9, Firefox and Chrome.

Go to \media\k2\assets\js\k2.js

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


before this
$K2('#catid').change(function(){
                                if($K2(this).find('option:selected').attr('disabled')){
                                        alert(K2Language[4]);
                                        $K2(this).val('0');
                                        return;
                                }

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

More
12 years 3 months ago #62704 by robm
Only works on Joomla 1.5.x (so not on 1.6 and 2.5 )

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


Powered by Kunena Forum