Advertisement:

Author Topic: Changing "Index" title  (Read 8290 times)

Offline MultiformeIngegno

  • Sophist Member
  • *****
  • Posts: 1,100
  • Gender: Male
  • Id quo maius cogitari nequit
    • RockCiclopedia
Changing "Index" title
« on: June 10, 2008, 12:29:20 PM »
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! :)
« Last Edit: September 07, 2008, 06:29:56 PM by lorenzone92 »
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

spearfish

  • Guest
Re: Changing "Index" title
« Reply #1 on: June 10, 2008, 01:22:56 PM »
Forum --> Themes --> Default --> Languages --> Index.English.php

Code: [Select]
# Line 48
$txt['forum_index'] = '%1$s - Index';

Offline MultiformeIngegno

  • Sophist Member
  • *****
  • Posts: 1,100
  • Gender: Male
  • Id quo maius cogitari nequit
    • RockCiclopedia
Re: Changing "Index" title
« Reply #2 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"
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Offline N3RVE

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,907
  • Gender: Male
    • N3RVE.COM
Re: Changing "Index" title
« Reply #3 on: June 10, 2008, 01:48:31 PM »
Please, Include details like Forum Version, etc.

For the Index Page, Try changing the code.

In this file:
./Themes/default/Index.template.php

Find:
Code: [Select]
<meta name="description" content="', $context['page_title'], '" />
Replace with:
Code: [Select]
<meta name="description" content="Your Chosen Description" />
Find:
Code: [Select]
<title>', $context['page_title'], '</title>
Replace with:
Code: [Select]
<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]
« Last Edit: June 10, 2008, 01:52:45 PM by [n3rve] »
Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Quote
“Somewhere, something incredible is waiting to be known.” - Carl Sagan

Offline MultiformeIngegno

  • Sophist Member
  • *****
  • Posts: 1,100
  • Gender: Male
  • Id quo maius cogitari nequit
    • RockCiclopedia
Re: Changing "Index" title
« Reply #4 on: June 10, 2008, 02:23:09 PM »
Find:
Code: [Select]
<title>', $context['page_title'], '</title>
Replace with:
Code: [Select]
<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
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Offline N3RVE

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,907
  • Gender: Male
    • N3RVE.COM
Re: Changing "Index" title
« Reply #5 on: June 10, 2008, 03:01:37 PM »
Find:
Code: [Select]
<title>', $context['page_title'], '</title>
Replace with:
Code: [Select]
<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]
Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Quote
“Somewhere, something incredible is waiting to be known.” - Carl Sagan

Offline ForumMustang.com

  • Full Member
  • ***
  • Posts: 467
  • Gender: Male
  • SMF French Translator
    • forummustang on Facebook
    • Ford Mustangs
Re: Changing "Index" title
« Reply #6 on: June 19, 2008, 12:02:58 PM »
 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:
Code: [Select]
<title>', $context['page_title'], ' - Your title here</title>

Offline Rumbaar

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,805
  • Gender: Male
  • Inherent Omniscience
    • Rumbaar.net
Re: Changing "Index" title
« Reply #7 on: July 03, 2008, 09:14:28 PM »
In $source/Display.php

find:
Code: [Select]
$context['page_title'] = $topicinfo['subject'];Change too:
Code: [Select]
$context['page_title'] = $topicinfo['subject'] - ' , $board , ';Though I'm not 1005 sure of the $board will be correctly populated.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

Offline ForumMustang.com

  • Full Member
  • ***
  • Posts: 467
  • Gender: Male
  • SMF French Translator
    • forummustang on Facebook
    • Ford Mustangs
Re: Changing "Index" title
« Reply #8 on: July 04, 2008, 10:16:53 AM »
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:
Code: [Select]
<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.

In $source/Display.php

find:
Code: [Select]
$context['page_title'] = $topicinfo['subject'];Change too:
Code: [Select]
$context['page_title'] = $topicinfo['subject'] - ' , $board , ';Though I'm not 1005 sure of the $board will be correctly populated.

Offline Rumbaar

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,805
  • Gender: Male
  • Inherent Omniscience
    • Rumbaar.net
Re: Changing "Index" title
« Reply #9 on: July 04, 2008, 06:38:13 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
Code: [Select]
$context['page_title'] = $topicinfo['subject'];
Change too:
Code: [Select]
$context['page_title'] = $topicinfo['subject'] . ' - ' . $board_info['name'];
Displays as in title and meta data as Topic Title - Board Name
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

Offline MultiformeIngegno

  • Sophist Member
  • *****
  • Posts: 1,100
  • Gender: Male
  • Id quo maius cogitari nequit
    • RockCiclopedia
Re: Changing "Index" title
« Reply #10 on: September 07, 2008, 01:01:34 PM »
Thanks for the replies! :)
« Last Edit: September 07, 2008, 01:04:55 PM by lorenzone92 »
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Offline Rumbaar

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,805
  • Gender: Male
  • Inherent Omniscience
    • Rumbaar.net
Re: Changing "Index" title
« Reply #11 on: September 07, 2008, 06:18:13 PM »
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.
 
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

Offline MultiformeIngegno

  • Sophist Member
  • *****
  • Posts: 1,100
  • Gender: Male
  • Id quo maius cogitari nequit
    • RockCiclopedia
Re: Changing "Index" title
« Reply #12 on: September 07, 2008, 06:30:11 PM »
Setted the tick icon! :)
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Offline MultiformeIngegno

  • Sophist Member
  • *****
  • Posts: 1,100
  • Gender: Male
  • Id quo maius cogitari nequit
    • RockCiclopedia
Re: Changing "Index" title
« Reply #13 on: September 08, 2008, 04:48:18 AM »
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.. :(
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Offline Rumbaar

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,805
  • Gender: Male
  • Inherent Omniscience
    • Rumbaar.net
Re: Changing "Index" title
« Reply #14 on: September 08, 2008, 08:50:49 AM »
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.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

Offline MultiformeIngegno

  • Sophist Member
  • *****
  • Posts: 1,100
  • Gender: Male
  • Id quo maius cogitari nequit
    • RockCiclopedia
Re: Changing "Index" title
« Reply #15 on: September 08, 2008, 04:33:57 PM »
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... :(
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Offline Rumbaar

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,805
  • Gender: Male
  • Inherent Omniscience
    • Rumbaar.net
Re: Changing "Index" title
« Reply #16 on: September 08, 2008, 05:53:41 PM »
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.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

Offline MultiformeIngegno

  • Sophist Member
  • *****
  • Posts: 1,100
  • Gender: Male
  • Id quo maius cogitari nequit
    • RockCiclopedia
Re: Changing "Index" title
« Reply #17 on: September 08, 2008, 06:07:00 PM »
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';
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Offline Rumbaar

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,805
  • Gender: Male
  • Inherent Omniscience
    • Rumbaar.net
Re: Changing "Index" title
« Reply #18 on: September 08, 2008, 06:44:17 PM »
Can you find $txt['forum_index'] at all?
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

Offline ForumMustang.com

  • Full Member
  • ***
  • Posts: 467
  • Gender: Male
  • SMF French Translator
    • forummustang on Facebook
    • Ford Mustangs
Re: Changing "Index" title
« Reply #19 on: September 08, 2008, 07:40:28 PM »
In the beta 4 the line has been replaced by:
Code: [Select]
$txt['forum_index'] = '%1$s - Index';