Advertisement:

Author Topic: Menu is getting out of control....how to move things in submenus?  (Read 1273 times)

Offline shadav

  • Full Member
  • ***
  • Posts: 419
  • Gender: Female
    • Ask The Muslims: A Place To Ask Honest Questions and Receive Respectful Answers
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

Offline Deaks

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 22,482
  • Gender: Male
    • SMFReview on Facebook
    • pouvik on GitHub
    • @@smfreview on Twitter
    • SMFReview
Re: Menu is getting out of control....how to move things in submenus?
« Reply #1 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.

Offline Sir Osis of Liver

  • SMF Super Hero
  • *******
  • Posts: 10,237
  • Hoarding Budweiser in NY
Re: Menu is getting out of control....how to move things in submenus?
« Reply #2 on: June 29, 2020, 12:36:34 PM »
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.

Code: [Select]

'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,
),
),
),


Offline shadav

  • Full Member
  • ***
  • Posts: 419
  • Gender: Female
    • Ask The Muslims: A Place To Ask Honest Questions and Receive Respectful Answers
Re: Menu is getting out of control....how to move things in submenus?
« Reply #3 on: June 29, 2020, 12:39:08 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
Code: [Select]
'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
Code: [Select]
'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,
),
),
),
),
),
),

Code: [Select]
'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,
),
),
),
),
),

Offline Sir Osis of Liver

  • SMF Super Hero
  • *******
  • Posts: 10,237
  • Hoarding Budweiser in NY
Re: Menu is getting out of control....how to move things in submenus?
« Reply #4 on: June 29, 2020, 12:45:53 PM »
Code: [Select]

'title' => Staff Links,


That's a 500 error.

Code: [Select]

'title' => 'Staff Links',



Offline Sir Osis of Liver

  • SMF Super Hero
  • *******
  • Posts: 10,237
  • Hoarding Budweiser in NY
Re: Menu is getting out of control....how to move things in submenus?
« Reply #6 on: June 29, 2020, 01:15:57 PM »
It's in the 'moderate' array but can't find it, and gotta go.

Offline Antechinus

  • SMF Friend
  • SMF Master
  • *
  • Posts: 25,298
  • Master of BBC Abuse
Re: Menu is getting out of control....how to move things in submenus?
« Reply #7 on: June 29, 2020, 06:36:31 PM »
Post your Subs.php up so we can take a look at the whole kaboodle. :)


Offline Antechinus

  • SMF Friend
  • SMF Master
  • *
  • Posts: 25,298
  • Master of BBC Abuse
Re: Menu is getting out of control....how to move things in submenus?
« Reply #9 on: June 29, 2020, 07:07:35 PM »
Try this one (back up the existing one, just in case).


Offline Antechinus

  • SMF Friend
  • SMF Master
  • *
  • Posts: 25,298
  • Master of BBC Abuse
Re: Menu is getting out of control....how to move things in submenus?
« Reply #11 on: June 29, 2020, 09:12:56 PM »
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?

Offline Antechinus

  • SMF Friend
  • SMF Master
  • *
  • Posts: 25,298
  • Master of BBC Abuse
Re: Menu is getting out of control....how to move things in submenus?
« Reply #12 on: June 29, 2020, 09:27:06 PM »
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?

Offline Sir Osis of Liver

  • SMF Super Hero
  • *******
  • Posts: 10,237
  • Hoarding Budweiser in NY
Re: Menu is getting out of control....how to move things in submenus?
« Reply #13 on: June 29, 2020, 09:50:56 PM »
I'm back.  Try this.  Make sure you've removed the original admin and moderate arrays.

Offline shadav

  • Full Member
  • ***
  • Posts: 419
  • Gender: Female
    • Ask The Muslims: A Place To Ask Honest Questions and Receive Respectful Answers
Re: Menu is getting out of control....how to move things in submenus?
« Reply #14 on: June 29, 2020, 10:04:39 PM »
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....

Offline shadav

  • Full Member
  • ***
  • Posts: 419
  • Gender: Female
    • Ask The Muslims: A Place To Ask Honest Questions and Receive Respectful Answers
Re: Menu is getting out of control....how to move things in submenus?
« Reply #15 on: June 29, 2020, 10:10:29 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....

Offline Sir Osis of Liver

  • SMF Super Hero
  • *******
  • Posts: 10,237
  • Hoarding Budweiser in NY
Re: Menu is getting out of control....how to move things in submenus?
« Reply #16 on: June 29, 2020, 10:14:30 PM »
You'll have to remove the mods to make this work.

Offline Antechinus

  • SMF Friend
  • SMF Master
  • *
  • Posts: 25,298
  • Master of BBC Abuse
Re: Menu is getting out of control....how to move things in submenus?
« Reply #17 on: June 29, 2020, 11:54:30 PM »
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).

Offline Antechinus

  • SMF Friend
  • SMF Master
  • *
  • Posts: 25,298
  • Master of BBC Abuse
Re: Menu is getting out of control....how to move things in submenus?
« Reply #18 on: July 01, 2020, 05:51:13 PM »
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.

Code: [Select]
'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.

Offline Mick.

  • Customizer
  • SMF Hero
  • *
  • Posts: 5,238
  • Gender: Male
    • idesignSMF on Facebook
    • @idesign360 on Twitter
    • idesignSMF.com
Re: Menu is getting out of control....how to move things in submenus?
« Reply #19 on: July 01, 2020, 06:06:27 PM »
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