Simple Machines Community Forum

Customizing SMF => Graphics and Templates => Topic started by: [chrisB] on March 17, 2025, 10:34:53 AM

Title: Active menu tab
Post by: [chrisB] on March 17, 2025, 10:34:53 AM
I do use SMFPacks Menu Editor Pro mod, but I believe the principle is the same.

I am trying to understand why certain pages created using TinyPortal decide to show in the 'home' tab of my site. There are pages which I have made that highlight on the right tab, but many do not. I would like to try to fix this, but I would need someone more knowledgeable to kindly explain the process.

URL: https://poetryartonline.com/about/

Here's an example
(https://i.imgur.com/ijId8DU.png)

What I need to understand is what file is responsible for this.

What part of the code makes the tab active and how to change it, so I can make the correct tab display.

Could anyone help me?

Many thanks, in advance.
Title: Re: Active menu tab
Post by: Kindred on March 17, 2025, 02:25:18 PM
If they are not defined in the active tab list in Subs.php and the name does not EXACTLY  match the action variable,  then it will show the active tab as home.

Also, all SUB menu items will default to home
Title: Re: Active menu tab
Post by: [chrisB] on March 17, 2025, 08:03:49 PM
I can add them to the subs.php right?

'about' => array(
    'title' => 'About',
    'href' => $scripturl . '/about/',
    'show' => true,
    'active_button' => $context['current_action'] == 'about',
    'sub_buttons' => array(),
),

It sounds simple enough, but I can't get the page to be active.

I've tried with the URL hardcoded, the category URL etc.

Any advice would be appreciated as always, thanks again.
Title: Re: Active menu tab
Post by: Kindred on March 18, 2025, 12:36:36 AM
The active tab system is the function AFTER  that...it's not quite as straightforward as the buttons