News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

How can I edit the main menu buttons?

Started by NexusXENU, December 10, 2018, 08:53:29 PM

Previous topic - Next topic

NexusXENU

Quote from: Arantor on December 17, 2018, 06:57:47 PM
For the links themselves, I just got confused trying to figure out the ordering of all the things (you will notice some things are there twice), but this should fix it:

$buttons = array(
'home' => array(
'title' => $txt['home'],
'href' => $scripturl,
'show' => true,
'sub_buttons' => array(
),
'is_last' => $context['right_to_left'],
),
'register_loggedin' => array(
'title' => $txt['register'],
'href' => $scripturl . '?board=3.0',
'show' => !$user_info['is_guest'],
'sub_buttons' => array(
),
),
'download' => array(
'title' => 'Download',
'href' => $scripturl . '?board=2.0',
'show' => !$user_info['is_guest'],
'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,
),
),
),
'profile' => array(
'title' => $txt['profile'],
'href' => $scripturl . '?action=profile',
'show' => $context['allow_edit_profile'],
'sub_buttons' => array(
'summary' => array(
'title' => $txt['summary'],
'href' => $scripturl . '?action=profile',
'show' => true,
),
'account' => array(
'title' => $txt['account'],
'href' => $scripturl . '?action=profile;area=account',
'show' => allowedTo(array('profile_identity_any', 'profile_identity_own', 'manage_membergroups')),
),
'profile' => array(
'title' => $txt['forumprofile'],
'href' => $scripturl . '?action=profile;area=forumprofile',
'show' => allowedTo(array('profile_extra_any', 'profile_extra_own')),
'is_last' => true,
),
),
),
'pm' => array(
'title' => $txt['pm_short'],
'href' => $scripturl . '?action=pm',
'show' => $context['allow_pm'],
'sub_buttons' => array(
'pm_read' => array(
'title' => $txt['pm_menu_read'],
'href' => $scripturl . '?action=pm',
'show' => allowedTo('pm_read'),
),
'pm_send' => array(
'title' => $txt['pm_menu_send'],
'href' => $scripturl . '?action=pm;sa=send',
'show' => allowedTo('pm_send'),
'is_last' => true,
),
),
),
'login' => array(
'title' => $txt['login'],
'href' => $scripturl . '?action=login',
'show' => $user_info['is_guest'],
'sub_buttons' => array(
),
),
'register_loggeout' => array(
'title' => $txt['register'],
'href' => $scripturl . '?action=register',
'show' => $user_info['is_guest'],
'sub_buttons' => array(
),
),
'facebook' => array(
'title' => 'Facebook',
'href' => 'https://facebook.com/MagicPT',
'show' => $user_info['is_guest'],
'sub_buttons' => array(
),
'is_last' => !$context['right_to_left'],
),
'logout' => array(
'title' => $txt['logout'],
'href' => $scripturl . '?action=logout;%1$s=%2$s',
'show' => !$user_info['is_guest'],
'sub_buttons' => array(
),
'is_last' => !$context['right_to_left'],
),
);


Fixing the icons is a lot more complex than I have energy for right now (it is nearly midnight here) but careful CSS should be able to fix that. If you hadn't insisted on two different registration buttons in two different places, that would have worked without any changes (since I would have just given it the correct class).

Ok now the register link works.

Have a great night no hurry

NexusXENU

Quote from: Arantor on December 17, 2018, 06:57:47 PM
For the links themselves, I just got confused trying to figure out the ordering of all the things (you will notice some things are there twice), but this should fix it:

$buttons = array(
'home' => array(
'title' => $txt['home'],
'href' => $scripturl,
'show' => true,
'sub_buttons' => array(
),
'is_last' => $context['right_to_left'],
),
'register_loggedin' => array(
'title' => $txt['register'],
'href' => $scripturl . '?board=3.0',
'show' => !$user_info['is_guest'],
'sub_buttons' => array(
),
),
'download' => array(
'title' => 'Download',
'href' => $scripturl . '?board=2.0',
'show' => !$user_info['is_guest'],
'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,
),
),
),
'profile' => array(
'title' => $txt['profile'],
'href' => $scripturl . '?action=profile',
'show' => $context['allow_edit_profile'],
'sub_buttons' => array(
'summary' => array(
'title' => $txt['summary'],
'href' => $scripturl . '?action=profile',
'show' => true,
),
'account' => array(
'title' => $txt['account'],
'href' => $scripturl . '?action=profile;area=account',
'show' => allowedTo(array('profile_identity_any', 'profile_identity_own', 'manage_membergroups')),
),
'profile' => array(
'title' => $txt['forumprofile'],
'href' => $scripturl . '?action=profile;area=forumprofile',
'show' => allowedTo(array('profile_extra_any', 'profile_extra_own')),
'is_last' => true,
),
),
),
'pm' => array(
'title' => $txt['pm_short'],
'href' => $scripturl . '?action=pm',
'show' => $context['allow_pm'],
'sub_buttons' => array(
'pm_read' => array(
'title' => $txt['pm_menu_read'],
'href' => $scripturl . '?action=pm',
'show' => allowedTo('pm_read'),
),
'pm_send' => array(
'title' => $txt['pm_menu_send'],
'href' => $scripturl . '?action=pm;sa=send',
'show' => allowedTo('pm_send'),
'is_last' => true,
),
),
),
'login' => array(
'title' => $txt['login'],
'href' => $scripturl . '?action=login',
'show' => $user_info['is_guest'],
'sub_buttons' => array(
),
),
'register_loggeout' => array(
'title' => $txt['register'],
'href' => $scripturl . '?action=register',
'show' => $user_info['is_guest'],
'sub_buttons' => array(
),
),
'facebook' => array(
'title' => 'Facebook',
'href' => 'https://facebook.com/MagicPT',
'show' => $user_info['is_guest'],
'sub_buttons' => array(
),
'is_last' => !$context['right_to_left'],
),
'logout' => array(
'title' => $txt['logout'],
'href' => $scripturl . '?action=logout;%1$s=%2$s',
'show' => !$user_info['is_guest'],
'sub_buttons' => array(
),
'is_last' => !$context['right_to_left'],
),
);


Fixing the icons is a lot more complex than I have energy for right now (it is nearly midnight here) but careful CSS should be able to fix that. If you hadn't insisted on two different registration buttons in two different places, that would have worked without any changes (since I would have just given it the correct class).

How can I fix the icon?

Arantor

#22
Jeesh, impatient much? I said it was late in my last reply, then I went to bed, and I'm just home from work, where this is something I couldn't fix at work because this requires more than 15 seconds of brainpower to fix.

I'll get to this when I get to this.

EDIT: Add the following to your theme's index.css file:

.fa-register_loggeout:before, .fa-register_loggedin:before {
    content: "\f084";
}

NexusXENU

Quote from: Arantor on December 18, 2018, 01:37:03 PM
Jeesh, impatient much? I said it was late in my last reply, then I went to bed, and I'm just home from work, where this is something I couldn't fix at work because this requires more than 15 seconds of brainpower to fix.

I'll get to this when I get to this.

EDIT: Add the following to your theme's index.css file:

.fa-register_loggeout:before, .fa-register_loggedin:before {
    content: "\f084";
}


I just thought you forgot me. Sorry for the impatient  ;)

Where to add it inside the index.css?

Arantor


Illori

Quote from: Arantor on December 18, 2018, 03:10:11 PM
Anywhere is fine.

that is not between a set of curly brackets, you want it outside them.

Arantor

I assumed slightly more intelligence than just to pick a totally random place ;)

NexusXENU


Arantor

Where did you add it to? I don't see the code in Themes/BarbarianTheme/css/index.css.

NexusXENU

Quote from: Arantor on December 22, 2018, 02:08:04 PM
Where did you add it to? I don't see the code in Themes/BarbarianTheme/css/index.css.

I added now again. still no icon.

Arantor

I see you added it - I suspect your browser has the old code because it shows up for me just fine...

GigaWatt

"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

NexusXENU

Quote from: Arantor on December 23, 2018, 06:36:58 PM
I see you added it - I suspect your browser has the old code because it shows up for me just fine...

It works now. Looks like it took some time until it was updated. Thanks a lot Arantor I appreciate your help

Advertisement: