Simple machines Forum default theme curve Main Menu modification method

Source: Internet
Author: User

I have to say that the default theme curve of SMF 2.0 is more beautiful than the previous theme! However, his main menu (Tab) button seems a little more, so now let's customize it.

Let's take a look at the main menu before customization:

Home Page, help, search, management, monitoring center, personal data, my messages, members, logout

Now let's get started with modification!

FTP path:/sources/subs. php
Find this line://
All the buttons we can possible want and then some, try pulling the final list of buttons from cache first

The following code is displayed:'home'
=> array(
'title' => $txt['home'],
'href' => $scripturl,
'show' => true,
'sub_buttons' => array(
),
'is_last' => $context['right_to_left'],
),
'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => true,
'sub_buttons' => array(
),
),
'search' => array(
'title' => $txt['search'],
'href' => $scripturl . '?action=search',
'show' => $context['allow_search'],
'sub_buttons' => array(
),
),

Here, home, help, and search correspond to the homepage, help, and search buttons on the main menu. You only need to add them according to their format and order.
For example, home
'Home' => array (// This 'home' is the button name and is not displayed on the interface.
'Title' => $ TXT ['home'], // The displayed text can use global variables or strings.
'Href '=> $ scripturl, // This is the URL to which
'Show' => true, // if it is set to true, the button is displayed. If it is set to false, the button is hidden.
'Sub _ Buttons' => array (// 'sub _ Buttons' is left blank here. If you need a drop-down menu, you need to fill in the content in array ().
),
'Is _ last' => $ context ['right _ to_left '],
),

Modify the drop-down menu (sub_buttons:
Check the code of the 'ps' button:'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,
),
),
),

In 'sub _ Buttons' => array (), the sub-menu code entered in the brackets is the same as the code format of the normal menu. Therefore, you only need to fill in the brackets of 'sub _ Buttons' => array () to implement the sub-menu function.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.