Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Topic started by: Burpee on April 25, 2005, 12:57:46 PM

Title: Always having your board name in the title of your forum
Post by: Burpee on April 25, 2005, 12:57:46 PM
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 :).
Title: Re: Always having your board name in the title of your forum
Post by: wiebke on April 29, 2005, 05:45:53 AM
thanks a lot!
Title: Re: Always having your board name in the title of your forum
Post by: [Unknown] on April 29, 2005, 11:16:13 AM
Why not just add it in the front of the <title> element in the index template?

-[Unknown]
Title: Re: Always having your board name in the title of your forum
Post by: Burpee on May 01, 2005, 03:12:19 PM
I did :P
Title: Re: Always having your board name in the title of your forum
Post by: [Unknown] on May 01, 2005, 07:09:19 PM
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]
Title: Re: Always having your board name in the title of your forum
Post by: dtm.exe on May 01, 2005, 10:16:28 PM
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
Title: Re: Always having your board name in the title of your forum
Post by: Burpee on May 02, 2005, 07:43:07 AM
lol
Read the second part of the post :D
Title: Re: Always having your board name in the title of your forum
Post by: dtm.exe on May 03, 2005, 01:08:14 AM
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
Title: Re: Always having your board name in the title of your forum
Post by: dtm.exe on May 04, 2005, 12:58:02 AM
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
Title: Re: Always having your board name in the title of your forum
Post by: 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 :)
Title: Re: Always having your board name in the title of your forum
Post by: dtm.exe on May 04, 2005, 01:01:17 AM
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
Title: Re: Always having your board name in the title of your forum
Post by: Burpee on May 04, 2005, 07:34:53 AM
Don't worry, the second time was my fault for not explaining it properly :)
Title: Re: Always having your board name in the title of your forum
Post by: 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.
Title: Re: Always having your board name in the title of your forum
Post by: Tristan Perry on June 26, 2005, 06:36:47 AM
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'] , '
Title: Re: Always having your board name in the title of your forum
Post by: 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.
Title: Re: Always having your board name in the title of your forum
Post by: Isaac on June 28, 2005, 05:58:05 PM
Wow, this code totally torched my index.template.php file. :(
Title: Re: Always having your board name in the title of your forum
Post by: dtm.exe on June 28, 2005, 06:07:30 PM
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
Title: Re: Always having your board name in the title of your forum
Post by: Burpee on June 28, 2005, 07:53:47 PM
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...
Title: Re: Always having your board name in the title of your forum
Post by: Burpee on June 28, 2005, 07:55:35 PM
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.
Title: Re: Always having your board name in the title of your forum
Post by: anunlike on June 28, 2005, 08:32:11 PM
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.
Title: Re: Always having your board name in the title of your forum
Post by: modtang on September 04, 2005, 08:23:09 PM
Quote from: Burpee on April 25, 2005, 12:57:46 PM
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.
Anyone else using SimplePortal? I'm getting MY COMMUNITY - MY COMMUNITY and I can't seem to fix it. Any suggestions?

Other than that this works great. Thanks a bunch. :)
Title: Re: Always having your board name in the title of your forum
Post by: grandslam on February 18, 2006, 05:27:23 PM
i made it to prevent on the index to have the forum name twice:

if (substr($context['page_title'],0,strlen($context['forum_name'])) == $context['forum_name'])
echo '<title>', $context['page_title'], '</title>';
else
echo '<title>',$context['forum_name'], ' - ', $context['page_title'], '</title>';

Title: Re: Always having your board name in the title of your forum
Post by: MKava on March 11, 2007, 12:20:09 AM
This works excellent. This was one of the few things that I disliked about SMF forums and so glad to have it fixed. Thanks! :D
Title: Re: Always having your board name in the title of your forum
Post by: heavyccasey on August 03, 2007, 11:34:05 PM
This is what I use:

if (! ereg($context['forum_name'], $context['page_title']))
$context['page_title'] = $context['forum_name']. ' - ' . $context['page_title'];
Title: Re: Always having your board name in the title of your forum
Post by: Aileen on November 26, 2007, 05:54:56 AM
I tried using a keyword. This one is good for SEO
Title: Re: Always having your board name in the title of your forum
Post by: Drover on April 15, 2008, 06:18:07 PM
First part went fine but my theme doesn't seem to have anything at all called "languages" or anything close...ideas?  I'm using the 1.Snake.1 theme.  :(
Title: Re: Always having your board name in the title of your forum
Post by: miamizx on April 23, 2008, 03:13:31 PM
Does anyone know how to remove the extra title in the TinyPortal index page? this is the only thing that I can't figure out...
Title: Re: Always having your board name in the title of your forum
Post by: Mac_Hines on June 02, 2008, 11:58:26 AM
Is there no control panel function for changing the name of your community after the initial set up?  Please forgive my extreme newbie-ness but I couldn't find this info anywhere (even though it's probably in a very obvious place). 

Apologies if this is posted in the wrong place.
Title: Re: Always having your board name in the title of your forum
Post by: b33z on June 04, 2008, 08:49:09 PM
nice. thanks for this.
Title: Re: Always having your board name in the title of your forum
Post by: Bulakbol on June 05, 2008, 03:38:00 AM
Quote from: Mac_Hines on June 02, 2008, 11:58:26 AM
Is there no control panel function for changing the name of your community after the initial set up?  Please forgive my extreme newbie-ness but I couldn't find this info anywhere (even though it's probably in a very obvious place). 

Apologies if this is posted in the wrong place.

Go to Admin -> Server Settings -> Core Configuration. Replace whatever is in "Forum Title" text box.
Title: Re: Always having your board name in the title of your forum
Post by: Mac_Hines on June 06, 2008, 03:12:33 PM
Quote from: JohnyB on June 05, 2008, 03:38:00 AM

Go to Admin -> Server Settings -> Core Configuration. Replace whatever is in "Forum Title" text box.

Thanks JohnyB.  It was right where you said it would be!
Title: Re: Always having your board name in the title of your forum
Post by: TigerTails on June 06, 2008, 05:03:50 PM
Quick hack-it-up for people who have long forum names that could be shortened, like mine ("Unseen Britain - Urban Exploration Community")

That was far too big to have on the front of every tab, and looked terrible.

So, I set "Urban Exploration Community" as my forum title in server options, and in index.template changed title to:
  <title>Unseen Britain - ', $context['page_title'], '</title>';

On the index it shows the usual "Unseen Britain - Urban Exploration Community", and for all other pages it shows "Unseen Britain - <Page name>". EG: "Unseen Britain - Read first"

Hope some of you can make some use of it :).
Title: Re: Always having your board name in the title of your forum
Post by: Bulakbol on June 06, 2008, 07:30:10 PM
You're welcome Mac_Hines. Glad I am of help.

Thank you Tiger Tails for your tip. I am sure it will help other members of our community.
Title: Re: Always having your board name in the title of your forum
Post by: Deal on August 19, 2008, 01:20:02 PM
I think if I knew the right word for this I would be able to find my answer elsewhere. This is as close to the subject as I found.

I like how the SMF forum displays a small avatar in the browser page name. Mine has the default browser avatar. I would like to add my own small image followed by my sitename (which this post details)
Title: Re: Always having your board name in the title of your forum
Post by: Bulakbol on August 19, 2008, 09:42:20 PM
Are you asking for favicon? We have mods.

http://custom.simplemachines.org/mods/index.php?mod=702
and
http://custom.simplemachines.org/mods/index.php?mod=1329

Title: Re: Always having your board name in the title of your forum
Post by: ccbtimewiz on August 19, 2008, 10:56:14 PM
Likewise, you can follow the guide I made too.

http://www.simplemachines.org/community/index.php?topic=236748.0
Title: Re: Always having your board name in the title of your forum
Post by: jepot5 on August 20, 2008, 04:05:59 AM
Hi
how do I fix this so whenever i go to someone's profile, I will see this

{Custom text I inputed} - Viewing Profile: {Display name}
Title: Re: Always having your board name in the title of your forum
Post by: ccbtimewiz on August 20, 2008, 10:21:13 AM
Quote from: jepot5 on August 20, 2008, 04:05:59 AM
Hi
how do I fix this so whenever i go to someone's profile, I will see this

{Custom text I inputed} - Viewing Profile: {Display name}

Open profile.php

Find:
// Set the page title if it's not already set...
if (!isset($context['page_title']))
$context['page_title'] = $txt['profile'] . ' - ' . $txt[$_REQUEST['sa']];


Replace with:
// Set the page title if it's not already set...
if (!isset($context['page_title']))
$context['page_title'] = 'Text you want to show '.$txt['profile'] . ' - ' . $txt[$_REQUEST['sa']];
Title: Re: Always having your board name in the title of your forum
Post by: Deal on August 20, 2008, 12:29:25 PM
Quote from: JohnyB on August 19, 2008, 09:42:20 PM
Are you asking for favicon? We have mods.

http://custom.simplemachines.org/mods/index.php?mod=702
and
http://custom.simplemachines.org/mods/index.php?mod=1329

Thank you - Yes exactly what I was looking for and the KarlBenson mod worked great.

Title: Re: Always having your board name in the title of your forum
Post by: Deal on August 21, 2008, 07:22:48 PM
I wonder if someone would be so kind as to assist me with a problem I am having trying to implement either of the solutions for implementing this change by modifying index_template.php  (the babylon theme)

I tried replacing line:

<title>', $context['page_title'], '</title>';

with grandslams mod, and then with Caseys mod and both resulted in a parsing error. I even compared (using notepad++) the resulting source of the file to ensure that that is the only mod to the file. I used the 1.1.5 babylon theme source as the master file.

Where did I go wrong here? Thanks.

Deal

The error I get is:

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in .../Themes/babylon/index.template.php on line 81

line 81 is either of the revised lines selected and pasted from this post.





Title: Re: Always having your board name in the title of your forum
Post by: jepot5 on August 22, 2008, 01:00:57 AM
Quote from: modtang on September 04, 2005, 08:23:09 PM
Quote from: Burpee on April 25, 2005, 12:57:46 PM
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.
Anyone else using SimplePortal? I'm getting MY COMMUNITY - MY COMMUNITY and I can't seem to fix it. Any suggestions?

Other than that this works great. Thanks a bunch. :)

in Sources/TPortal.php, find:
$context['page_title'] =

remove
$context['forum_name']

replace with your own
Title: Re: Always having your board name in the title of your forum
Post by: jepot5 on August 22, 2008, 01:16:39 AM
Quote from: ccbtimewiz on August 20, 2008, 10:21:13 AM
Quote from: jepot5 on August 20, 2008, 04:05:59 AM
Hi
how do I fix this so whenever i go to someone's profile, I will see this

{Custom text I inputed} - Viewing Profile: {Display name}

Open profile.php

Find:
// Set the page title if it's not already set...
if (!isset($context['page_title']))
$context['page_title'] = $txt['profile'] . ' - ' . $txt[$_REQUEST['sa']];


Replace with:
// Set the page title if it's not already set...
if (!isset($context['page_title']))
$context['page_title'] = 'Text you want to show '.$txt['profile'] . ' - ' . $txt[$_REQUEST['sa']];


thanks for the help, but not working,

i think the profile pages integrate with tinyportal as when i did the editing for tinyportal (see above post) it also shows the same title when viewing profiles only

and also help me fix
My Community - My Community: Calendar (The first phrase is what I entered and I want to remove "My Community:")
Title: Re: Always having your board name in the title of your forum
Post by: serge06 on August 27, 2008, 01:07:07 AM
Any way to have the title show:
Board Name - Forum Category - Post Title

for even better SEO
Thanks
Title: Re: Always having your board name in the title of your forum
Post by: krick on August 27, 2008, 02:05:24 AM
I'm using this...


$context['page_title'] = $context['linktree'][0]['name']. ' - ' .
                                      $context['linktree'][1]['name']. ' - ' .
                                      $context['linktree'][2]['name']. ' - ' .
                                      $context['linktree'][3]['name'];


To get...

forum title - category - board name - topic

...as my page title.

The only problem is that when I'm at higher levels of the hierarchy, I get extra dashes.  I need to add code to omit the empty elements.
Title: Re: Always having your board name in the title of your forum
Post by: Paracelsus on August 27, 2008, 04:33:51 AM
Since I didn't like to put "Home" or "Index" in the first page, my solution was:

In index.template.php put a "short version" of the board name + page title:
<title>F&oacute;rum SCP - ', $context['page_title'], '</title>';

In index."language".php put the trimmed part to have the "long version" of the board name, since this is shown just in Home or Index page:
$txt[18] = 'A Comunidade do Sporting Clube de Portugal';

So in sum, except for Index page where we have the full forum title, every other page show "Fórum SCP - Page Title".
Title: Re: Always having your board name in the title of your forum
Post by: Sabby72 on August 30, 2008, 04:37:08 PM
Could Someone please tell me if I did something wrong. I don't think I did, but the title now shows up as - - Index, whereas it used to show up as - Index. I obviously missed something, as it didn't change to show the forum name.

Here's what I replaced:
Index.template.php on line 79:
<title>', $context['forum_name'], ' - ', $context['page_title'], '</title>';

index.english.php on line 36:
$txt[18] = 'Index';

Thanks. As you can see, I'm somewhat new to php.

Title: Re: Always having your board name in the title of your forum
Post by: sabby on September 11, 2008, 10:47:48 PM
I give up. I've tried this at least a dozen times now and it never works.
Title: Re: Always having your board name in the title of your forum
Post by: Paracelsus on September 12, 2008, 06:55:21 AM
Quote from: Sabby72 on August 30, 2008, 04:37:08 PM
Could Someone please tell me if I did something wrong. I don't think I did, but the title now shows up as - - Index, whereas it used to show up as - Index. I obviously missed something, as it didn't change to show the forum name.

Here's what I replaced:
Index.template.php on line 79:
<title>', $context['forum_name'], ' - ', $context['page_title'], '</title>';

index.english.php on line 36:
$txt[18] = 'Index';

Thanks. As you can see, I'm somewhat new to php.



It probably means that in Boardindex.php in Sources - I think it's this file that uses $txt[18], you have most likely something weird before $txt[18] that gives - - before the Index word the whole time.
Title: Re: Always having your board name in the title of your forum
Post by: krick on September 15, 2008, 05:43:15 PM
Sabby, undo your other changes, and then add this to index.template.php ....
(just the new code part between the begin/end comments)



function template_main_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

// -- begin build better page title --
$tboard = $context['linktree'][2]['name'];
$tboard = empty($tboard)?'':' - '.$tboard;
$ttopic = $context['linktree'][3]['name'];
$ttopic = empty($ttopic)?'':' - '.$ttopic;
if (! ereg($context['forum_name'], $context['page_title']))
$context['page_title'] = $context['linktree'][0]['name'].$tboard.$ttopic;
// -- end build better page title --
Title: Re: Always having your board name in the title of your forum
Post by: krick on September 26, 2008, 04:45:17 PM
For some reason, the code in my last post generates errors in the log.

This version of the code doesn't.  Am I missing something subtle about the PHP syntax?


$tboard = empty($context['linktree'][2]['name'])?'':' - '.$context['linktree'][2]['name'];
$ttopic = empty($context['linktree'][3]['name'])?'':' - '.$context['linktree'][3]['name'];
if (! ereg($context['forum_name'], $context['page_title']))
  $context['page_title'] = $context['linktree'][0]['name'].$tboard.$ttopic;
Title: Re: Always having your board name in the title of your forum
Post by: SleePy on October 23, 2008, 06:56:08 PM
It would be helpful to know the php error.
Title: Re: Always having your board name in the title of your forum
Post by: minos on January 05, 2009, 01:21:37 PM
hi .. i delete  $txt[18] = $context['forum_name'] . ' - &Iacute;ndice';

from my index english and spanish  index but does not work
Title: Re: Always having your board name in the title of your forum
Post by: studentforums on August 16, 2009, 07:13:42 AM
I want the page number of the topic to display in the title. I understand I have to modify Sources/Display.php among others.

These two lines from Display.php are where I think the problems are

   censorText($topicinfo['subject']);
   $context['page_title'] = $topicinfo['subject'] . " - " . $txt['page'] . $context['page_info']['current_page'];

There is another piece of code in Sources/Messageindex.php which does the smes thing for the boards.

     // 'Print' the header and board info.   
     $context['page_title'] = strip_tags($board_info['name'] . " - " . $txt['page'] . $context['page_info']['current_page']);

Why does the second piece of code display the page number but not the first?
Title: Re: Always having your board name in the title of your forum
Post by: Arantor on August 16, 2009, 07:37:14 AM
Likely you'll see an error in the error log for an undefined index for $context['page_info']['current_page'] in the first case; it's built differently from what I remember of it.
Title: Re: Always having your board name in the title of your forum
Post by: thischarmingmanc on August 17, 2009, 11:38:50 AM
The whole concept is  very bad for SEO the SMF guys knew what they were doing.

to add the same word for verey page on your site, dilutes your unique content, thus making every page on your site less search engine friendly. 

Quote from: Aileen on November 26, 2007, 05:54:56 AM
I tried using a keyword. This one is good for SEO
Title: Re: Always having your board name in the title of your forum
Post by: Arantor on August 17, 2009, 12:52:57 PM
Quote from: thischarmingmanc on August 17, 2009, 11:38:50 AM
The whole concept is  very bad for SEO the SMF guys knew what they were doing.

to add the same word for verey page on your site, dilutes your unique content, thus making every page on your site less search engine friendly.

Not if it's the site name or contains a unique keyword that is relevant to the site.
Title: Re: Always having your board name in the title of your forum
Post by: Shark-Time on August 17, 2009, 02:25:57 PM
very nice will try it soon..
Title: Re: Always having your board name in the title of your forum
Post by: studentforums on August 24, 2009, 09:16:53 AM
Ok I think the title is to my satisfaction apart from my quibbles in my last post.
Title: Re: Always having your board name in the title of your forum
Post by: heavyccasey on August 24, 2009, 05:55:41 PM
Another solution is to use a Favicon.
Title: Re: Always having your board name in the title of your forum
Post by: Shark-Time on September 12, 2009, 09:33:11 AM
nice sharing thanks mate...
Title: Re: Always having your board name in the title of your forum
Post by: Matthew K. on September 12, 2009, 03:10:45 PM
Great modification!

However, for me at least when i'm on the index.php it says "My Forum Name - My Forum Name Index" so for the index it repeats "My Forum Name" instead of just showing "My Forum Name - Index"

Any easy ways you see around this?

Thanks!
Title: Re: Always having your board name in the title of your forum
Post by: Arantor on October 10, 2009, 08:17:21 AM
On the very front page or somewhere else?

And is that for SMF 1.1 or 2.0?
Title: Re: Always having your board name in the title of your forum
Post by: flickernever on December 07, 2009, 04:16:23 PM
  $tboard = empty($context['linktree'][2]['name'])?'':' - '.$context['linktree'][2]['name'];
   $ttopic = empty($context['linktree'][3]['name'])?'':' - '.$context['linktree'][3]['name'];
   if (! ereg($context['forum_name'], $context['page_title']))   
        $context['page_title'] = $context['linktree'][0]['name'].$tboard.$ttopic;


This is code works but doesn't print the topic title in child boards. Any idea how I can do it?
Title: Re: Always having your board name in the title of your forum
Post by: ShowMeYourStyle on January 03, 2010, 01:20:11 PM
Hi guys,

I got a problem with my custom mod (made by a friend of mine)
the link is: смотреть фильмы онлайн (http://kinogrill.kz)

As you see, it uses my forum title, is there a way to fix it, say the title would be "Matches"

Could someone help me out?

Thanks,
Rashid
Title: Re: Always having your board name in the title of your forum
Post by: krick on July 01, 2010, 06:01:09 PM
Just an update to my earlier post.  It appears that ereg() is being deprecated in PHP, so I updated the code to use strpos() instead, which happens to be faster anyway.


$tboard = empty($context['linktree'][2]['name'])?'':' - '.$context['linktree'][2]['name'];
$ttopic = empty($context['linktree'][3]['name'])?'':' - '.$context['linktree'][3]['name'];
if (strpos($context['page_title'], $context['forum_name']) === false)
$context['page_title'] = $context['linktree'][0]['name'].$tboard.$ttopic;


Title: Re: Always having your board name in the title of your forum
Post by: Coon on February 08, 2011, 03:15:23 PM
Quote from: grandslam on February 18, 2006, 05:27:23 PM
i made it to prevent on the index to have the forum name twice:

if (substr($context['page_title'],0,strlen($context['forum_name'])) == $context['forum_name'])
echo '<title>', $context['page_title'], '</title>';
else
echo '<title>',$context['forum_name'], ' - ', $context['page_title'], '</title>';



I'm getting this error when I use this code:

Template Parse Error!
It seems something has gone sour on the forum with the template system. This problem should only be temporary, so please come back later and try again. If you continue to see this message, please contact the administrator.

I got version 1.1.11.  I've also seen another error that suggested code with ' needed be be closed off with \ or ;.  Is there a missing piece of code?

Thanks!
Title: Re: Always having your board name in the title of your forum
Post by: Oldiesmann on February 08, 2011, 04:16:32 PM
There is nothing wrong with the code above. Where did you put it in your template file?
Title: Re: Always having your board name in the title of your forum
Post by: Coon on February 14, 2011, 02:30:56 PM
Same spot as instructed.  Weird... I wonder if it has to do with my PHP version?
Title: Re: Always having your board name in the title of your forum
Post by: ammaar102 on February 23, 2011, 12:08:34 AM
I'm a newbie and do not know much about these things. I didn't really get these bit confused....     :o  :-[
Title: Re: Always having your board name in the title of your forum
Post by: Dblog on October 18, 2011, 10:09:59 AM
how to add board/child board name in between topic title - and - forum title in 'page title'