Advertisement:

Author Topic: Always having your board name in the title of your forum  (Read 97347 times)

Offline Burpee

  • SMF Friend
  • Sophist Member
  • *
  • Posts: 1,298
  • Gender: Male
    • Mafan.nl
Always having your board name in the title of your forum
« on: April 25, 2005, 12:57:46 PM »
I'm probably not the only one who has noticed this, but regular installs of SMF seem to often have an unclear title.
The title will be something along the lines of "Start new topic", or just the title of that particular thread.
Personally, I prefer seeing the title of my board in front of the topic title, to avoid confusion between different boards.
So, I'll show you the trick to doing that, right here.


Remember to ALWAYS make backups of the files you are modifying!

Open: index.template.php of the theme you are using.
If it's not there, Copy that file from SMF/Themes/default/languages/ to the languages directory of the theme you are using.

Find:
Code: [Select]
<title>', $context['page_title'], '</title>';
Replace with:
Code: [Select]
<title>', $context['forum_name'], ' - ', $context['page_title'], '</title>';

Custom board title
You've just added ', $context['forum_name'], ' - in front of your title, which is the name of your board. If you prefer having some other custom text there, this would be the place to put it.

The problem now is that the index of your forum is going to have something like "My community - My community - Index" as a title. This is easily fixed through the language files.

Copy: Forum/Themes/default/languages/index.*language*.php to the languages directory of the theme you are using, to avoid losing these modifications when updating.

Open: index.*language*.php

Find:
Code: [Select]
$txt[18] = $context['forum_name'] . ' -
Remove: $context['forum_name'] . ' -

Now, if everything went well, the name of your forum should be visible in the title on every page of your forum, and the title of your boardindex should be a single title :).
« Last Edit: May 04, 2005, 07:31:38 AM by Burpee »

Offline wiebke

  • Jr. Member
  • **
  • Posts: 156
Re: Always having your board name in the title of your forum
« Reply #1 on: April 29, 2005, 05:45:53 AM »
thanks a lot!

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Always having your board name in the title of your forum
« Reply #2 on: April 29, 2005, 11:16:13 AM »
Why not just add it in the front of the <title> element in the index template?

-[Unknown]

Offline Burpee

  • SMF Friend
  • Sophist Member
  • *
  • Posts: 1,298
  • Gender: Male
    • Mafan.nl
Re: Always having your board name in the title of your forum
« Reply #3 on: May 01, 2005, 03:12:19 PM »
I did :P

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Always having your board name in the title of your forum
« Reply #4 on: May 01, 2005, 07:09:19 PM »
I read the bottom part and didn't see why you wanted to mess with the language strings... never mind, I suppose.  Not sleeping enough.

-[Unknown]

Offline dtm.exe

  • SMF Hero
  • ******
  • Posts: 5,465
Re: Always having your board name in the title of your forum
« Reply #5 on: May 01, 2005, 10:16:28 PM »
That was exactly what I needed for my forums :).  One Problem: on the index page of my forums, the title is OI Forums - OI Forums.  How can that be fixed, or can it?

-Dan The Man
« Last Edit: May 01, 2005, 10:18:01 PM by OIDanTheManIO »

Offline Burpee

  • SMF Friend
  • Sophist Member
  • *
  • Posts: 1,298
  • Gender: Male
    • Mafan.nl
Re: Always having your board name in the title of your forum
« Reply #6 on: May 02, 2005, 07:43:07 AM »
lol
Read the second part of the post :D

Offline dtm.exe

  • SMF Hero
  • ******
  • Posts: 5,465
Re: Always having your board name in the title of your forum
« Reply #7 on: May 03, 2005, 01:08:14 AM »
lol
Read the second part of the post :D

D'oh!  I'm sorry.  I didn't even see that there.  I feel like such a n00b :P.  Thank you.

-Dan The Man

Offline dtm.exe

  • SMF Hero
  • ******
  • Posts: 5,465
Re: Always having your board name in the title of your forum
« Reply #8 on: May 04, 2005, 12:58:02 AM »
Quote
Open: index.*language*.php

The SMFOne theme doesn't include that file :-\.  So that file's not there, which file should I edit?

-Dan The Man

Offline Kirby

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,040
  • Gender: Male
Re: Always having your board name in the title of your forum
« Reply #9 on: May 04, 2005, 12:59:29 AM »
Copy over index.english.php from Themes/default/languages to Themes/<smf one directory>/languages and edit that :)

Offline dtm.exe

  • SMF Hero
  • ******
  • Posts: 5,465
Re: Always having your board name in the title of your forum
« Reply #10 on: May 04, 2005, 01:01:17 AM »
Copy over index.english.php from Themes/default/languages to Themes/<smf one directory>/languages and edit that :)

Oh is that what it was telling me to do?  This is the second time I've made myself look like a complete n00b in ONE THREAD :P.  Sorry about that.  Thanks.

-Dan The Man

Offline Burpee

  • SMF Friend
  • Sophist Member
  • *
  • Posts: 1,298
  • Gender: Male
    • Mafan.nl
Re: Always having your board name in the title of your forum
« Reply #11 on: May 04, 2005, 07:34:53 AM »
Don't worry, the second time was my fault for not explaining it properly :)

Offline anunlike

  • Sr. Member
  • ****
  • Posts: 746
  • Gender: Male
Re: Always having your board name in the title of your forum
« Reply #12 on: June 26, 2005, 06:29:44 AM »
I just tried this today. I followed these steps and used
Code: [Select]
', $context['forum_name'] , ': but, on my board index page (the homepage), I get
Quote
AUW FORUMS:

I'm hoping for
Quote
AUW FORUMS

Did I not do this correctly or is the ':' supposed to show up?

Thanks much.

Offline Tristan Perry

  • SMF Hero
  • ******
  • Posts: 2,498
  • Gender: Male
    • Tristan Perry
Re: Always having your board name in the title of your forum
« Reply #13 on: June 26, 2005, 06:36:47 AM »
I just tried this today. I followed these steps and used
Code: [Select]
', $context['forum_name'] , ': but, on my board index page (the homepage), I get
Quote
AUW FORUMS:

I'm hoping for
Quote
AUW FORUMS

Did I not do this correctly or is the ':' supposed to show up?

Thanks much.
To remove the colan, use the following:

Code: [Select]
', $context['forum_name'] , '

Offline anunlike

  • Sr. Member
  • ****
  • Posts: 746
  • Gender: Male
Re: Always having your board name in the title of your forum
« Reply #14 on: June 26, 2005, 01:12:08 PM »
Thanks. Yes, I understand that, I should've clarified. However, I want the colon to show up whenever I'm on any page other than the board index page. In this instance, I'm using it to replace the ' - (dash) '. But, It still shows up on my board index page. I'm wondering if it's possible using this method (or something similar) to keep it for all the other forums pages but not have it show on the board index page.

I suppose I'm just overlooking something.

Offline Isaac

  • Sophist Member
  • *****
  • Posts: 1,140
  • Gender: Male
    • Funky Arcade
Re: Always having your board name in the title of your forum
« Reply #15 on: June 28, 2005, 05:58:05 PM »
Wow, this code totally torched my index.template.php file. :(

Offline dtm.exe

  • SMF Hero
  • ******
  • Posts: 5,465
Re: Always having your board name in the title of your forum
« Reply #16 on: June 28, 2005, 06:07:30 PM »
Wow, this code totally torched my index.template.php file. :(

Worked fine for me...

-Dan The Man

Offline Burpee

  • SMF Friend
  • Sophist Member
  • *
  • Posts: 1,298
  • Gender: Male
    • Mafan.nl
Re: Always having your board name in the title of your forum
« Reply #17 on: June 28, 2005, 07:53:47 PM »
Wow, this code totally torched my index.template.php file. :(

I really can't imagine how...

Offline Burpee

  • SMF Friend
  • Sophist Member
  • *
  • Posts: 1,298
  • Gender: Male
    • Mafan.nl
Re: Always having your board name in the title of your forum
« Reply #18 on: June 28, 2005, 07:55:35 PM »
Thanks. Yes, I understand that, I should've clarified. However, I want the colon to show up whenever I'm on any page other than the board index page. In this instance, I'm using it to replace the ' - (dash) '. But, It still shows up on my board index page. I'm wondering if it's possible using this method (or something similar) to keep it for all the other forums pages but not have it show on the board index page.

I suppose I'm just overlooking something.

Seems to me like you already fixed it on your forum? I do believe it makes more sense to lable the front page with something like "Home" or "Index" as well.

Offline anunlike

  • Sr. Member
  • ****
  • Posts: 746
  • Gender: Male
Re: Always having your board name in the title of your forum
« Reply #19 on: June 28, 2005, 08:32:11 PM »
Yes, I just decided to put the "HOME" after the forum title. But, I was trying not to have the "HOME" (or anything else) after it. The problem wasn't getting something after the colon, it was trying to use this method and not having anything after the forum title, which I don't think I can do, as the colon will always be there. But, it's a great way of doing this.