Want home menu button to default to forum

Started by JPA, July 28, 2010, 01:11:07 PM

Previous topic - Next topic

JPA

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.
As above, so below.

Matthew K.

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?

JPA

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
As above, so below.

Matthew K.

./Sources/Subs.php
Code (Find) Select

$buttons = array(
'home' => array(
'title' => $txt['home'],
'href' => $scripturl,
'show' => true,
'sub_buttons' => array(
),
'is_last' => $context['right_to_left'],
// 'target' => '_blank',
),

Code (Replace) Select

$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.

JPA

Thanks, I'll have to give that a shot tonight.  Off to my 'OTHER' job lol.  I'll post my results ;)
As above, so below.

JPA

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. 
As above, so below.

CapadY

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',
         ),
Please, don't PM me for support unless invited.
If you don't understand this, you will be blacklisted.

JPA

Thank you capady, now all I need is to have the forum load as the home page on sign in and I'm set!
As above, so below.

Matthew K.

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. '';,

JPA

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
As above, so below.

Advertisement: