Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Aiheen aloitti: sambosh - helmikuu 02, 2014, 10:26:25 IP

Otsikko: Trying to Change "Home" Menu Link URL
Kirjoitti: sambosh - helmikuu 02, 2014, 10:26:25 IP
Hi all,

I'm trying to change the url that my home menu links to.  I've read lots in the SMF forum, but I don't recognize any of the code in my index.template.php.

Can someone give me a hand?  I've been going nuts trying to fix this for hours.
Otsikko: Re: Trying to Change "Home" Menu Link URL
Kirjoitti: ApplianceJunk - helmikuu 02, 2014, 10:32:25 IP
Look in Sources/Subs.php
Otsikko: Re: Trying to Change "Home" Menu Link URL
Kirjoitti: sambosh - helmikuu 02, 2014, 11:12:42 IP
I can't locate Sources/Subs.php ??
Otsikko: Re: Trying to Change "Home" Menu Link URL
Kirjoitti: Sir Osis of Liver - helmikuu 02, 2014, 11:17:04 IP

The /Sources/ directory is in your forum root.  Subs.php contains the menu button array.  Look for 'All the buttons'.

Otsikko: Re: Trying to Change "Home" Menu Link URL
Kirjoitti: sambosh - helmikuu 02, 2014, 11:32:06 IP
Okay great I found it: forum/Sources/Subs-Menu.php

Is that what I want?  What do I do next?
Otsikko: Re: Trying to Change "Home" Menu Link URL
Kirjoitti: ApplianceJunk - helmikuu 02, 2014, 11:38:18 IP
Yea, that's what you want.

Search the text for the word, home

The code for your home button looks like this.

$buttons = array(
'home' => array(
'title' => $txt['home'],
'href' => $scripturl,
'show' => true,
'sub_buttons' => array(
),


Change the 'href' to what ever you want the button to link to.
Otsikko: Re: Trying to Change "Home" Menu Link URL
Kirjoitti: ApplianceJunk - helmikuu 02, 2014, 11:40:21 IP
For example

Change this...

'href' => $scripturl,

to this...

'href' => 'http://simplemachines.org',
Otsikko: Re: Trying to Change "Home" Menu Link URL
Kirjoitti: ApplianceJunk - helmikuu 02, 2014, 11:41:52 IP
Lainaus käyttäjältä: sambosh - helmikuu 02, 2014, 11:32:06 IP
Okay great I found it: forum/Sources/Subs-Menu.php

Is that what I want?  What do I do next?

Wait, you want Sources/Sub.php

Not Subs-Menu.php

Keep looking in Sources until you find Subs.php
Try the search function of your ftp program.
Otsikko: Re: Trying to Change "Home" Menu Link URL
Kirjoitti: sambosh - helmikuu 03, 2014, 12:00:02 AP
YOU ARE AMAZING!!!  Thanks so much, I really mean that :)