Hi! ;)
I'd like to change the <title></title> of the home page (that is "Name of the Forum - Index") and have something like "Name of the Forum - Main Page"...
What do I have to edit?
Thanks! :)
Forum --> Themes --> Default --> Languages --> Index.English.php
# Line 48
$txt['forum_index'] = '%1$s - Index';
OK, and how to change it for topics?
I'd like to have "Topic name - name of the board"
Please, Include details like Forum Version, etc.
For the Index Page, Try changing the code.
In this file:
./Themes/default/Index.template.php
Find:
<meta name="description" content="', $context['page_title'], '" />
Replace with:
<meta name="description" content="Your Chosen Description" />
Find:
<title>', $context['page_title'], '</title>
Replace with:
<title>', ( $context['user']['is_logged'] ? $context['page_title'] : 'Your Title Here' ) , '</title>
Change to desired text.
Thats the bit that will be shown to guests if they try to view any page.
-[n3rve]
Quote from: [n3rve] on June 10, 2008, 01:48:31 PM
Find:
<title>', $context['page_title'], '</title>
Replace with:
<title>', ( $context['user']['is_logged'] ? $context['page_title'] : 'Your Title Here' ) , '</title>
Mmmh... I didn't understand what this code do...
Anyway my forum version is 2.0 Beta 3
Quote from: lorenzone92 on June 10, 2008, 02:23:09 PM
Quote from: [n3rve] on June 10, 2008, 01:48:31 PM
Find:
<title>', $context['page_title'], '</title>
Replace with:
<title>', ( $context['user']['is_logged'] ? $context['page_title'] : 'Your Title Here' ) , '</title>
Mmmh... I didn't understand what this code do...
Anyway my forum version is 2.0 Beta 3
Thats the bit that will be shown to guests if they try to view any page.
-[n3rve]
This title code doesn't work on my 2.0 beta 3 forum and didn't show the topic title to guests.
I used a mod I had on the older version:
<title>', $context['page_title'], ' - Your title here</title>
In $source/Display.php
find:
$context['page_title'] = $topicinfo['subject'];
Change too:
$context['page_title'] = $topicinfo['subject'] - ' , $board , ';
Though I'm not 1005 sure of the $board will be correctly populated.
I tested it but for some reason only the first word of the topic name is showing in the meta title.
Here is what I did to show the topic name and board name:
In index.template.php of my theme:
<title>', $context['page_title'] != "$context[forum_name] - Index" ? "$context[forum_name] - " : '', $context['page_title'], '</title>
The problem is that I can't replace the Index word in the home page. When I replace it in the code above I get the forum name displayed twice. The Index word is not very important but I think SMF would really need to be improved to show the board name in the meta title of each topic and board.
This topic meta is "Changing Index title". Wouldn't it be better if it was "Changing Index title - Simple machine Community forum"? All other forum softwares are showing both.
Quote from: Rumbaar on July 03, 2008, 09:14:28 PM
In $source/Display.php
find:
$context['page_title'] = $topicinfo['subject'];
Change too:
$context['page_title'] = $topicinfo['subject'] - ' , $board , ';
Though I'm not 1005 sure of the $board will be correctly populated.
Quote from: lorenzone92 on June 10, 2008, 01:43:05 PM
OK, and how to change it for topics?
I'd like to have "Topic name - name of the board"
Well I was trying to answer the original creator of this threads question chadon. You need to change this in the source files and not in the template files.
I've test it this time and it will add the name of the board to the page title
Find in $source/Display.php
$context['page_title'] = $topicinfo['subject'];
Change too:
$context['page_title'] = $topicinfo['subject'] . ' - ' . $board_info['name'];
Displays as in title and meta data as
Topic Title - Board Name
Thanks for the replies! :)
If this is solved feel free to mark it as solved otherwise reply with some details of what isn't working. To mark an issue solved please change the first post message icon to the 'tick' icon or click the 'Topic Solved' button at the bottom of the thread if available.
Setted the tick icon! :)
Anoher question...
I'd like to have "Index - Forum name" instead of "Forum Name - Index"...
I've changed in
Forum --> Themes --> Default --> Languages --> Index.English.php
$txt['forum_index'] = '%1$s - Index';
to
$txt['forum_index'] = 'Index - %1$s';
... but it doesn't work.. :(
Are you sure you are editing it in the correct language file? As I just changed it on my SMF 2.x forum and it worked perfectly how you wanted it.
OK, it worked, was my cache...
Now there's another problem, I've upgradedd to Beta 4 and I can't find that option anymore... :(
You can't find the cache? I can't say I've used BETA 4 yet, but I don't think the changes were that great that they moved/hide/ or removed that feature.
D'oh!
I mean, I can't find anymore in:
Forum --> Themes --> Default --> Languages --> Index.English.php
the line:
$txt['forum_index'] = '%1$s - Index';
Can you find $txt['forum_index'] at all?
In the beta 4 the line has been replaced by:
$txt['forum_index'] = '%1$s - Index';
Which is the same as in 3.1 :)
:o I must need glasses.
Then there is no changes in the beta 4 :D