Hello, I'm looking to set my menu to have the frontpage display for all guests and unlogged users via the home menu button, and I would like to be able to have the the home menu button point to the forum for all users once they are logged in. Any help or suggestions would be appreciated.
If I am understanding this correctly, you have a homepage, which is where you want the forums "Home" button to link to, and if they're logged in, the home button should link to the actual forums home?
Yes, I want to Have the home menu button link to the forum index, "/index.php?action=forum" for all logged in users. and have the menu button point to the frontpage for all guests and non logged in users
./Sources/Subs.php
$buttons = array(
'home' => array(
'title' => $txt['home'],
'href' => $scripturl,
'show' => true,
'sub_buttons' => array(
),
'is_last' => $context['right_to_left'],
// 'target' => '_blank',
),
$buttons = array(
'home' => array(
'title' => $txt['home'],
'href' => $scripturl,
'show' => !$user_info['is_guest'],
'sub_buttons' => array(
),
'is_last' => $context['right_to_left'],
// 'target' => '_blank',
),
'home' => array(
'title' => $txt['home'],
'href' => 'http://www.yourdomainroothere.com/',
'show' => $user_info['is_guest'],
'sub_buttons' => array(
),
'is_last' => $context['right_to_left'],
// 'target' => '_blank',
),
That *should* work for you.
Thanks, I'll have to give that a shot tonight. Off to my 'OTHER' job lol. I'll post my results ;)
This created a new button. My apologies for not being more clear. On the forum there is a front page that displays, that is linked to the home menu button, what I'd like to accomplish is once users log in to have the forum display, not the front page, and have the home menu button point to the forum instead of the front page.
I didn test it but try this, it should at least solve a part of your problems:
'home' => array(
'title' => $txt['home'],
'href' => $user_info['is_guest'] ? 'http://www.yourdomainroothere.com/' : 'http://www.yourforumroothere.com/' ;,
'show' => true,
'sub_buttons' => array(
),
'is_last' => $context['right_to_left'],
// 'target' => '_blank',
),
Thank you capady, now all I need is to have the forum load as the home page on sign in and I'm set!
My code did the same thing capady's did, just a different way.
Capady - Instead of putting
'href' => $user_info['is_guest'] ? 'http://www.yourdomainroothere.com/' : 'http://www.yourforumroothere.com/' ;,
It should be
'href' => $user_info['is_guest'] ? 'http://www.yourdomainroothere.com/' : ''. $scripturl. '';,
Labradoodle, capady, thank you for helping me resolve the menu button issue. Any suggestions on how to load the forum on log in and not the front page.
Any suggestions would be greatly appreciated! :D