Hide components on page 'new menu item' in the menu manager
When you make a new menu item, you might want to hide the components not used in the site, or hide them because you do not want any backend users to make links to them.
This is a template override to achieve hiding specific components in that list. A template override is a extra file that gets stored in the template which does not affect the core in any way, so this is no hack and you will not have any problems when updating the Joomla core.
There is no installer as Joomla does not provide install-functionality for template overrides.
download:
com_menus_template_override_hides_components.zip
How to install:
- determine which backend template you are using. If you never changed this it is 'Khepri'.
If you are not sure check at 'extensions' > 'templates' > 'administrator' to see which your default template is. - Unzip the file
- copy-paste the folder 'com_menus' to:
administrator/templates/your_template/html/
- open the file:
administrator/templates/your_template/html/com_menus/item/type.php - on line 10 at $components_to_hide, add all components you want to hide in the array and save the file.
If you want to hide specific views read in the same file from line 16-28 on how to do that:
//to hide specific component views is a little more ticky, but if you know your html it can be done
//please note that if you change to another admin language you html-strings would also change
//you basically replace the html with nothing, thus ripping the html out
//$expansion = str_replace('_html_you_want_out_','',$expansion);
/*
//example 1. ripping out section blog layout
$expansion = str_replace('<li><div class="leaf"><span></span><a class="hasTip" href="index.php?option=com_menus&task=edit&type=component&url[option]=com_content&url[view]=section&url[layout]=blog&menutype=mainmenu" title="Section Blog Layout::Displays a list of Articles in a Section in a Blog format.">Section Blog Layout</a></div></li>','',$expansion);
//example 2. ripping out category list layout
$expansion = str_replace('<li class="last"><div class="leaf"><span></span><a class="hasTip" href="index.php?option=com_menus&task=edit&type=component&url[option]=com_content&url[view]=category&menutype=mainmenu" title="Category List Layout::This layout displays Articles in a Category.">Category List Layout</a></div></li>','',$expansion);
*/