Menu is getting out of control....how to move things in submenus?

Started by shadav, June 29, 2020, 11:57:19 AM

Previous topic - Next topic

shadav

So my menu is getting a bit out of control

how can move things around into more submenus

Like I don't know maybe make a menu called My Links and move the profile and pm into it

And a (not sure what to name it) menu and move the member list, buddy page, and staff list into it

and maybe a staff menu and move the moderator and admin menu to it

I'm assuming in the subs.php

everything that I try I keep getting HTTP ERROR 500

Deaks

Have you looked at the Menu Editor mods?

Also you need to alter the subs.php to do this manually, if you post your subs.php we can help better.
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

Sir Osis of Liver

Take one of the existing menus with submenus from the buttons array and substitute whatever you wany in it.  Use unique names for each array.



'moderate' => array(
'title' => $txt['moderate'],
'href' => $scripturl . '?action=moderate',
'show' => $context['allow_moderation_center'],
'sub_buttons' => array(
'modlog' => array(
'title' => $txt['modlog_view'],
'href' => $scripturl . '?action=moderate;area=modlog',
'show' => !empty($modSettings['modlog_enabled']) && !empty($user_info['mod_cache']) && $user_info['mod_cache']['bq'] != '0=1',
),
'poststopics' => array(
'title' => $txt['mc_unapproved_poststopics'],
'href' => $scripturl . '?action=moderate;area=postmod;sa=posts',
'show' => $modSettings['postmod_active'] && !empty($user_info['mod_cache']['ap']),
),
'attachments' => array(
'title' => $txt['mc_unapproved_attachments'],
'href' => $scripturl . '?action=moderate;area=attachmod;sa=attachments',
'show' => $modSettings['postmod_active'] && !empty($user_info['mod_cache']['ap']),
),
'reports' => array(
'title' => $txt['mc_reported_posts'],
'href' => $scripturl . '?action=moderate;area=reports',
'show' => !empty($user_info['mod_cache']) && $user_info['mod_cache']['bq'] != '0=1',
'is_last' => true,
),
),
),

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

shadav

Quote from: Deaks on June 29, 2020, 12:00:01 PM
Have you looked at the Menu Editor mods?

Also you need to alter the subs.php to do this manually, if you post your subs.php we can help better.

nothing i've found in the mod list does this....there's mods to add menu items, rearrange menu items....but not to move them into submenus and such


so for instance in my subs.php the admin and moderator
'admin' => array(
'title' => $txt['admin'],
'href' => $scripturl . '?action=admin',
'show' => $context['allow_admin'],
'sub_buttons' => array(
'featuresettings' => array(
'title' => $txt['modSettings_title'],
'href' => $scripturl . '?action=admin;area=featuresettings',
'show' => allowedTo('admin_forum'),
),
'packages' => array(
'title' => $txt['package'],
'href' => $scripturl . '?action=admin;area=packages',
'show' => allowedTo('admin_forum'),
),
'errorlog' => array(
'title' => $txt['errlog'],
'href' => $scripturl . '?action=admin;area=logs;sa=errorlog;desc',
'show' => allowedTo('admin_forum') && !empty($modSettings['enableErrorLogging']),
),
'permissions' => array(
'title' => $txt['edit_permissions'],
'href' => $scripturl . '?action=admin;area=permissions',
'show' => allowedTo('manage_permissions'),
'is_last' => true,
),
),
),
'moderate' => array(
'title' => $txt['moderate'],
'href' => $scripturl . '?action=moderate',
'show' => $context['allow_moderation_center'],
'sub_buttons' => array(
'modlog' => array(
'title' => $txt['modlog_view'],
'href' => $scripturl . '?action=moderate;area=modlog',
'show' => !empty($modSettings['modlog_enabled']) && !empty($user_info['mod_cache']) && $user_info['mod_cache']['bq'] != '0=1',
),
'poststopics' => array(
'title' => $txt['mc_unapproved_poststopics'],
'href' => $scripturl . '?action=moderate;area=postmod;sa=posts',
'show' => $modSettings['postmod_active'] && !empty($user_info['mod_cache']['ap']),
),
'attachments' => array(
'title' => $txt['mc_unapproved_attachments'],
'href' => $scripturl . '?action=moderate;area=attachmod;sa=attachments',
'show' => $modSettings['postmod_active'] && !empty($user_info['mod_cache']['ap']),
),
'reports' => array(
'title' => $txt['mc_reported_posts'],
'href' => $scripturl . '?action=moderate;area=reports',
'show' => !empty($user_info['mod_cache']) && $user_info['mod_cache']['bq'] != '0=1',
'is_last' => true,
),
),
),

instead of these being separate menu items, i'd like them to be one menu item and 2 submenus (with their own submenus)

these gives 500 error

'stafflinks' => array(
'title' => Staff Links,
'show' => $context['allow_moderation_center'],
'sub_buttons' => array(
'admin' => array(
'title' => $txt['admin'],
'href' => $scripturl . '?action=admin',
'show' => $context['allow_admin'],
'sub_buttons' => array(
'featuresettings' => array(
'title' => $txt['modSettings_title'],
'href' => $scripturl . '?action=admin;area=featuresettings',
'show' => allowedTo('admin_forum'),
),
'packages' => array(
'title' => $txt['package'],
'href' => $scripturl . '?action=admin;area=packages',
'show' => allowedTo('admin_forum'),
),
'errorlog' => array(
'title' => $txt['errlog'],
'href' => $scripturl . '?action=admin;area=logs;sa=errorlog;desc',
'show' => allowedTo('admin_forum') && !empty($modSettings['enableErrorLogging']),
),
'permissions' => array(
'title' => $txt['edit_permissions'],
'href' => $scripturl . '?action=admin;area=permissions',
'show' => allowedTo('manage_permissions'),
'is_last' => true,
),
),
),
'moderate' => array(
'title' => $txt['moderate'],
'href' => $scripturl . '?action=moderate',
'show' => $context['allow_moderation_center'],
'sub_buttons' => array(
'modlog' => array(
'title' => $txt['modlog_view'],
'href' => $scripturl . '?action=moderate;area=modlog',
'show' => !empty($modSettings['modlog_enabled']) && !empty($user_info['mod_cache']) && $user_info['mod_cache']['bq'] != '0=1',
),
'poststopics' => array(
'title' => $txt['mc_unapproved_poststopics'],
'href' => $scripturl . '?action=moderate;area=postmod;sa=posts',
'show' => $modSettings['postmod_active'] && !empty($user_info['mod_cache']['ap']),
),
'attachments' => array(
'title' => $txt['mc_unapproved_attachments'],
'href' => $scripturl . '?action=moderate;area=attachmod;sa=attachments',
'show' => $modSettings['postmod_active'] && !empty($user_info['mod_cache']['ap']),
),
'reports' => array(
'title' => $txt['mc_reported_posts'],
'href' => $scripturl . '?action=moderate;area=reports',
'show' => !empty($user_info['mod_cache']) && $user_info['mod_cache']['bq'] != '0=1',
'is_last' => true,
),
),
),
),
),
),



'stafflinks' => array(
'title' => Staff Links,
'show' => $context['allow_moderation_center'],
'sub_buttons' => array(
'admin' => array(
'title' => $txt['admin'],
'href' => $scripturl . '?action=admin',
'show' => $context['allow_admin'],
'sub_buttons' => array(
'featuresettings' => array(
'title' => $txt['modSettings_title'],
'href' => $scripturl . '?action=admin;area=featuresettings',
'show' => allowedTo('admin_forum'),
),
'packages' => array(
'title' => $txt['package'],
'href' => $scripturl . '?action=admin;area=packages',
'show' => allowedTo('admin_forum'),
),
'errorlog' => array(
'title' => $txt['errlog'],
'href' => $scripturl . '?action=admin;area=logs;sa=errorlog;desc',
'show' => allowedTo('admin_forum') && !empty($modSettings['enableErrorLogging']),
),
'permissions' => array(
'title' => $txt['edit_permissions'],
'href' => $scripturl . '?action=admin;area=permissions',
'show' => allowedTo('manage_permissions'),
'is_last' => true,
),
),
'moderate' => array(
'title' => $txt['moderate'],
'href' => $scripturl . '?action=moderate',
'show' => $context['allow_moderation_center'],
'sub_buttons' => array(
'modlog' => array(
'title' => $txt['modlog_view'],
'href' => $scripturl . '?action=moderate;area=modlog',
'show' => !empty($modSettings['modlog_enabled']) && !empty($user_info['mod_cache']) && $user_info['mod_cache']['bq'] != '0=1',
),
'poststopics' => array(
'title' => $txt['mc_unapproved_poststopics'],
'href' => $scripturl . '?action=moderate;area=postmod;sa=posts',
'show' => $modSettings['postmod_active'] && !empty($user_info['mod_cache']['ap']),
),
'attachments' => array(
'title' => $txt['mc_unapproved_attachments'],
'href' => $scripturl . '?action=moderate;area=attachmod;sa=attachments',
'show' => $modSettings['postmod_active'] && !empty($user_info['mod_cache']['ap']),
),
'reports' => array(
'title' => $txt['mc_reported_posts'],
'href' => $scripturl . '?action=moderate;area=reports',
'show' => !empty($user_info['mod_cache']) && $user_info['mod_cache']['bq'] != '0=1',
'is_last' => true,
),
),
),
),
),


Sir Osis of Liver



'title' => Staff Links,



That's a 500 error.



'title' => 'Staff Links',


Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

shadav

Quote from: Sir Osis of Liver on June 29, 2020, 12:45:53 PM


'title' => Staff Links,



That's a 500 error.



'title' => 'Staff Links',



thanks for the correction, but still gives 500 error

Sir Osis of Liver

It's in the 'moderate' array but can't find it, and gotta go.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Antechinus

Post your Subs.php up so we can take a look at the whole kaboodle. :)

shadav


Antechinus


shadav

well that half way worked.... no 500 error but also no submenu for the admin or moderator menus.....

Antechinus

That looks weird. It shouldn't display the button title twice if it's only defined once in the array. Is that running the exact file I attached?

Antechinus

Ok, just tried code straight from the file I attached, on my test site. Works perfectly. :D

What have you done to my nice shiny code?

Sir Osis of Liver

I'm back.  Try this.  Make sure you've removed the original admin and moderate arrays.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

shadav

bwahahaha Iz dids nuffin

erm it's probably either the alternative menu mod thingie or the working top level for drop down links mod

my menu's just does that  :laugh:
on a drop down, the first listing is the original menu for some strange reason....

shadav

Quote from: Sir Osis of Liver on June 29, 2020, 09:50:56 PM
I'm back.  Try this.  Make sure you've removed the original admin and moderate arrays.

unfortunately same issue, no submenus for admin/mod
and apparently the rest of my menus disappeared....

Sir Osis of Liver

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Antechinus

Yup. Kill mods first (I noticed you weren't using their stuff for actual buttons yet). See if nice shiny code works without mods in the way (I know it does). Can proceed from there, if you still want menu mods (may require body armour and pointy sticks).

Antechinus

Did you end up getting this to work? It's all just bog standard button arrays, so it should work. In fact it should be easy.

Was thinking about the mods too. Really, as long as they don't bork the standard menu buttons they shouldn't bork this custom one either. The only reason they might (or should) is if you were trying to use the same array name for two different buttons. An example would be if you left the default admin button while trying to throw in this custom one too.

'sub_buttons' => array(
'admin' => array(


You can use 'sub_buttons' => array( as often as you like, but you can only use 'admin' => array( once in the whole menu.

Mick.

There are other buttons like the 'help' button and from other mods that add buttons to the menu that you can set it from show=> true to false. It alleviates the menu mumble jumble. You can still use these buttons on a side block if you wish. Help, Search, Calendar, Members

Subs.php near the bottom. 3/4 of the way

Advertisement: