MyBB Community Forums

Full Version: how to put the site name adjacent to the post title?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi!
I realized that whem browsing a topic, only the title of that topic will appear on the "Window title" of the browser. I want to put my site title adjacent to the title of the thread [in windows title of the browser], that will help alot in distribute my site through the search engines.

is there anyway to do that?
I hope that my question was clear.

Thank's in advance
Use this in title in showthread template:

{$mybb->settings['bbname']}

Example:

<title>{$mybb->settings['bbname']} - {$thread['subject']}</title>
Goto:
AdminCP >> Templates & Style >> Templates >> (Your Theme) >> Show Thread Templates >> showthread

Find:
<title>{$thread['subject']}</title>

Replace with:
<title>{$thread['subject']} - {$mybb->settings['bbname']}</title>

I'm pretty sure it's not good for SEO though. Relevent titles (i.e. just the thread title) are better.
RateU & AJS Thank's alot
it worked, but 2 problems appeared:
1) the long thread's subject are cut... not all characters appeared.
2) the words of thread's subject and site title are overlapped. I tried to write:
<title>{$thread['subject']} <div align="right">- {$mybb->settings['bbname']}</div></title>

but <div align="right"></div> are shown as a text becase its a title, and title dosn't accept html code.

how can I solve these 2 problems?

Thank's alot
No you can't put a div in a title tag, the title tag is what shows at the top of a browser window or tab. Why do you need to align it anyway?? Subjects shouldn't be cut as {$thread['subject']} is just the subject of the thread and is used in other places. I don't see how they can 'overlap' either, it's just one piece of text after another. If you can provide a link we might be able to see what you're talking about.
Mr.Matt, the overlaping occur when the 2 sentences (thread's subject and site name) are written in different language (arabic=> right-to-left language) and (english=>left-to-right language).

about cutting, it may be because of the browser? IE may accept only a number of characters in the title of the page?
You probably just can't mix LTR and RTL languages then. And yes, the length of the title is limited by the size of the tab or the browser... from memory IE does cut off the title after a certain length, nothing you'll be able to do to stop it because it's the browser cutting it off.