News:

Wondering if this will always be free?  See why free is better.

Main Menu

Browser Page Title

Started by hw15, March 29, 2006, 04:52:51 PM

Previous topic - Next topic

hw15

Hi,

I installed the SMF forum fairly recently and have been successful in making a couple mods to the index.template.php file. But, now I am stumped.

How can I change the browser page title? Right now, it says "New Page 4 - Microsoft Internet Explorer" and stays that way on all pages, and all forums and posts. Is it supposed to change dynamically based on the page viewed? How can I set that attribute? In looking at the browser page title on this screen right now, it reads "Simple Machines - Start new topic - Microsoft Internet Explorer."

I would simply be satisfied with one standard, static page title for all pages, such as "MyBrowserPageTitle"... if only I could figure out how to set that attribute!

I have located the metatags and title code in the index.template.php file as follows:

// Show right to left and the character set for ease of translating.
   echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "hxxp:www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd [nonactive]">
<html', $context['right_to_left'] ? ' dir="rtl"' : '', '><head>
   <meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
   <meta name="description" content="', $context['page_title'], '" />
   <meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />
   <script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js"></script>
   <script language="JavaScript" type="text/javascript"><!--
      var smf_theme_url = "', $settings['theme_url'], '";
      var smf_images_url = "', $settings['images_url'], '";
   // --></script>
   <title>', $context['page_title'], '</title>';

The last line above shows that the page title should be displaying, but still I am only seeing "New Page 4" at the top of my browser. Why!?

I have already tried changing the title line as follows:

             <title>MyBrowserPageTitle</title>';

Unfortunately, this had no effect and my browser page title still reads "New Page 4 - Microsoft Internet Explorer."

If anyone has a suggestion, it would be greatly apprecitated.

Thanks!

adamspt2

You can go into Admin and under Server Settings, put in a name for your board title.

I'm trying to do something similar because that change only seems to apply the the index and not interior pages. I'd like the title to carry through, along with the variable text on each page so that it would say something like 'board title' - $context['page_title'].

But I can't figure that out.

adamspt2

Incidentally, something very similar to what SMF does on their boards...

adamspt2


Advertisement: