News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Tips/Trick SMF 2.1.x: Add Home Button in Footer Area

Started by Rumpa, November 24, 2022, 08:05:23 AM

Previous topic - Next topic

Rumpa

Hello members my first post in this section.
Here i share something which may helpful.

Add Home button in Footer area just below SMF copyright area.

Tips/tricks:


Theme/default/index.template.php

Search
<li class="copyright">', theme_copyright(), '</li>

Add after
                  <li class="last"><a id="button_home" href="', $scripturl , '"class="new_win"><span>', $txt['home'], '</span></a></li>
languagedir/Modifications.english.php

Search
?>
Add before
$txt['home'] = 'Home';
And see the result



Steve

Before we can approve this, there's just one thing that's missing:

QuoteYou should also add the version number in the title. If it works in more than one version, you can add both.
For example, is this for 2.1.x series or 2.0.x series or both?

I've fixed your post to conform to the other requirements of this board (check the sticky topic).
DO NOT pm me for support unless asked to!

Rumpa

Quote from: Steve on November 24, 2022, 08:24:21 AMBefore we can approve this, there's just one thing that's missing:

QuoteYou should also add the version number in the title. If it works in more than one version, you can add both.
For example, is this for 2.1.x series or 2.0.x series or both?

I've fixed your post to conform to the other requirements of this board (check the sticky topic).

It's work in SMF 2.1.x i did not test in SMF 2.0

Illori

href="', $scripturl , '?home"
as far as i know this url, ?home does not exist in SMF so it would send you back to the home page anyway. so your mod is using code that it does not need to use. it should just go back to the $scripturl. of course if the forum is using a portal this may vary.

also you are not defining $txt['home'] anywhere so the error log will get filled up and your button will not show correctly.

Rumpa

#4
Quote from: Illori on November 24, 2022, 08:38:01 AMhref="', $scripturl , '?home"
as far as i know this url, ?home does not exist in SMF so it would send you back to the home page anyway. so your mod is using code that it does not need to use. it should just go back to the $scripturl. of course if the forum is using a portal this may vary.

also you are not defining $txt['home'] anywhere so the error log will get filled up and your button will not show correctly.
But i am using it and no error log there.
yes if forum using portal this may vary.

Steve

I removed just the ?home and it works fine for me. Can a coder verify that this is correct without it so we can get this topic approved?
DO NOT pm me for support unless asked to!

Kindred

The use of ?home is wrong,  because it does not exist.

And any txt string needs to be added to modifications.english.php

In other words,  this "tip" is wrong in all sorts of ways.

Rejected.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Rumpa

Quote from: Kindred on November 24, 2022, 09:18:19 PMThe use of ?home is wrong,  because it does not exist.

And any txt string needs to be added to modifications.english.php

In other words,  this "tip" is wrong in all sorts of ways.

Rejected.

Modified please check

Diego Andrés

Looks good so far.

Quote from: Rumpa on November 24, 2022, 08:05:23 AMlanguagedir/Modifications.english.php

Search
end
Add before
$txt['home'] = 'Home';

Please fix this, there's no end word, could cause confusion.
Use ?>, or simply advice to add it at the end of the file.

SMF Tricks - Free & Premium Responsive Themes for SMF.

Rumpa

Quote from: Diego Andrés on November 25, 2022, 06:42:19 PMLooks good so far.

Quote from: Rumpa on November 24, 2022, 08:05:23 AMlanguagedir/Modifications.english.php

Search
end
Add before
$txt['home'] = 'Home';

Please fix this, there's no end word, could cause confusion.
Use ?>, or simply advice to add it at the end of the file.
fixed please check

Steve

Looks like she's got all the problems corrected, any reason not to approve it now?
DO NOT pm me for support unless asked to!

live627

isn't that the same $txt var that the menu uses, which should mean that it is always defined?

Advertisement: