Add to page title without removing "page_title_html_safe"

Started by ɔɔɔɔɔɔuɥoɾ, February 23, 2010, 12:00:07 PM

Previous topic - Next topic

ɔɔɔɔɔɔuɥoɾ

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!


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Nick Whetstone

What, exactly, are you trying to add after it? You may be able to do this by editing that $context.
The artist formerly known as (Ha)²

Former Support Specialist

Please do not solicit support via PM. Here's why!

ɔɔɔɔɔɔuɥoɾ

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"


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Nick Whetstone

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.
The artist formerly known as (Ha)²

Former Support Specialist

Please do not solicit support via PM. Here's why!

ɔɔɔɔɔɔuɥoɾ

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!


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Nick Whetstone

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.
The artist formerly known as (Ha)²

Former Support Specialist

Please do not solicit support via PM. Here's why!

Mick.

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.

ɔɔɔɔɔɔuɥoɾ

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


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers


ɔɔɔɔɔɔuɥoɾ

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']


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Nick Whetstone

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.
The artist formerly known as (Ha)²

Former Support Specialist

Please do not solicit support via PM. Here's why!

ɔɔɔɔɔɔuɥoɾ

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!


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Mick.

You can add it before $context too

<title>Something Here ', $context['page_title_html_safe'], '</title>';

ɔɔɔɔɔɔuɥoɾ

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.


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Advertisement: