Hi,
I'm trying to add some more page information to the forum, but I dont want to remove
<title>', $context['page_title_html_safe'], '</title>';
Since if I do all the sections will have the exact same title in the whole forum, I know I need to add something after it, but getting parse errors, and sometimes the title changes to " 0 ".
Any Ideas anybody?
Thanks in Advanced!
What, exactly, are you trying to add after it? You may be able to do this by editing that $context.
I cannot change that as it uses more complex code than just grabbing from the database as it changes depending on which part of the forum your on, I Think.
I did this before, I simply added some regular text afterward and it was set, Like change the forum name, but only for the page titles not the whole forum
I believe I added something inside it
<title>', $context['page_title_html_safe']MAYBE SOMETHING HERE OR NEAR THIS AREA, '</title>';
But I have not got it working right yet.
The Idea is to change the forum name, but only in the title section eg:
My Forum is your forum name, which by default will be added as title
we want to change only the title to "My Forum Something Something"
Try going to /Themes/default/languages/index.english.php and finding this line:
$txt['forum_index'] = '%1$s - Index';
"%1$s" is your forum name. Edit that line to whatever you want (Keep it all within the two single quotes, though.). Put a \ in front of any apostrophes.
Is there not a way to do it by changing the index.template.php file, I know that what I did before, I will try what you suggested though
Thanks!
The page title isn't defined in the index template, but in the BoardIndex source file. :) It's usually better to edit language files instead of source files, if possible.
In my forums i replaced:
- Index
from here:
$txt['forum_index'] = '%1$s - Index';
with: - Forums
It looks like this:
$txt['forum_index'] = '%1$s -Forums';
I would think you can add anything you want there. It will show in the board index only.
Hmm..
When I changed it in the index.template.php file it was global, it worked everywhere and nothing else was disturbed, eg: Search would still be in title while searching.
The same thing applied to post titles too, That also worked well, the post title then the forum name then my edit, it was always there, that how I want it to be :)
You tried this?
http://www.simplemachines.org/community/index.php?topic=34221.0
Never Mind - I got it now
it was index.template.php
<title>', $context['page_title_html_safe'], 'Something Here</title>';
When using this, remember to start with a space to separate it from the generated title from $context['page_title_html_safe']
I'm glad you got it, but the reason we did it the other way is that it's better to do edits in the language files than it is in Source/template files when possible.
In this case it would not be possible, as I need a global change, however, I always wanted to change that "Index" to "Forum" So I did get something from this thread today :)
If there is a way to make a global title change using the language files, I would much rather do that as, changing the theme and source files makes it harder for mods to install, but Im done with mods, I have made changes and all set up, no more mods for me anyway, my forum is already complete as it is
Thanks for the help guys!
You can add it before $context too
<title>Something Here ', $context['page_title_html_safe'], '</title>';
you can completely remove everything between <title> and </title> too and add your title there, but as I said before, the title will be the same for every section/page, not very Search Engine friendly at all lol
the "page_title_html_safe" part is the part which basically changes the title for every part of the forum, IMO it should always be there no matter what.