News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Always having your board name in the title of your forum

Started by Burpee, April 25, 2005, 12:57:46 PM

Previous topic - Next topic

Burpee

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:
<title>', $context['page_title'], '</title>';

Replace with:
<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:
$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 :).


[Unknown]

Why not just add it in the front of the <title> element in the index template?

-[Unknown]

Burpee


[Unknown]

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]

dtm.exe

#5
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

Burpee


dtm.exe

Quote from: Burpee on May 02, 2005, 07:43:07 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

dtm.exe

QuoteOpen: 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

Kirby

Copy over index.english.php from Themes/default/languages to Themes/<smf one directory>/languages and edit that :)

dtm.exe

Quote from: Kirby 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 :)

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

Burpee

Don't worry, the second time was my fault for not explaining it properly :)

anunlike

I just tried this today. I followed these steps and used
', $context['forum_name'] , ':
but, on my board index page (the homepage), I get
QuoteAUW FORUMS:

I'm hoping for
QuoteAUW FORUMS

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

Thanks much.

Tristan Perry

Quote from: anunlike on June 26, 2005, 06:29:44 AM
I just tried this today. I followed these steps and used
', $context['forum_name'] , ':
but, on my board index page (the homepage), I get
QuoteAUW FORUMS:

I'm hoping for
QuoteAUW FORUMS

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

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

', $context['forum_name'] , '

anunlike

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.

Isaac

Wow, this code totally torched my index.template.php file. :(

dtm.exe

Quote from: Isaac on June 28, 2005, 05:58:05 PM
Wow, this code totally torched my index.template.php file. :(

Worked fine for me...

-Dan The Man

Burpee

Quote from: Isaac on June 28, 2005, 05:58:05 PM
Wow, this code totally torched my index.template.php file. :(

I really can't imagine how...

Burpee

Quote from: anunlike 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.

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.

anunlike

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.

Advertisement: