News:

Wondering if this will always be free?  See why free is better.

Main Menu

Sub-Menus

Started by dieselv2, August 22, 2015, 03:15:51 PM

Previous topic - Next topic

dieselv2

How do I remove menus such as those on profile screen

Profile Info
Modify Profile
Actions

I have added these as a drop down on main menu now

Kindred

regardless of having added the to the main menu -- you really don't want to remove the from the profile menu.

The user may access them directly fomr the main menu -- but they don't want to go BACK to the main menu once they are in the profile section.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

margarett

That is actually tricky. I would suggest that it could be handled via CSS but the menu uses GenericMenu so the div has no unique ID.

There is a "trick" which works. You need to go to Sources/Profile.php and find the massive array for profile areas. You find this:
$profile_areas = array(
'info' => array(
'title' => $txt['profileInfo'],
'areas' => array(
'summary' => array(
'label' => $txt['summary'],
'file' => 'Profile-View.php',
'function' => 'summary',
'permission' => array(
'own' => 'profile_view_own',
'any' => 'profile_view_any',
),
),
'statistics' => array(
'label' => $txt['statPanel'],
'file' => 'Profile-View.php',

You can, for each "area", add a "hidden => true". That will keep the action active but the menu entry not displayed. So, eg:
$profile_areas = array(
'info' => array(
'title' => $txt['profileInfo'],
'areas' => array(
'summary' => array(
'hidden' => true,
'label' => $txt['summary'],
'file' => 'Profile-View.php',
'function' => 'summary',
'permission' => array(
'own' => 'profile_view_own',
'any' => 'profile_view_any',
),
),
'statistics' => array(
'hidden' => true,
'label' => $txt['statPanel'],
'file' => 'Profile-View.php',

If you hide all areas, the top menu will also be hidden. Unfortunately, you can't hide all menus or else you'll get a nice error
QuoteYou are not allowed to access this section
This happens on purpose and you can't bypass it...

Do note, as Kindred says, you might get a "weird" navigation experience...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

margarett

OK, I'm a bit stubborn so I made this work, with CSS as it should :P

Here we go. Forget the last post, head to GenericMenu.template.php and find this:
// This contains the html for the side bar of the admin center, which is used for all admin pages.
function template_generic_menu_dropdown_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

Add after:
if (isset($_REQUEST['action']) && ($_REQUEST['action'] == 'profile'))
$at_profile = 1;


Then find
echo '
<div id="admin_menu">
<ul class="dropmenu" id="dropdown_menu_', $context['cur_menu_id'], '">';

Replace with:
if (empty($at_profile))
echo '
<div id="admin_menu">';
else
echo '
<div id="profile_menu">';
echo '
<ul class="dropmenu" id="dropdown_menu_', $context['cur_menu_id'], '">';


Finally, get index.css and find:
#admin_menu
{
min-height: 2em;
padding-left: 0;
}

Add after
#profile_menu
{
display: none;
}

And there you go, a completely invisible profile menu :)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

dieselv2

Hmmmm this doesn't seem to work :(

dieselv2

Nevermind it updates.  Took about an hour to cache....all working, thanks!

ilookpair

it's work for me too, Thanks  ;D

Advertisement: