For MediaWiki Skin Setting HTML Title to "[Site Name]" instead of "Main Page - [Site Name]"
I'm using a custom 开发者_C百科version of the monobook skin. How do I set the HTML title to "[Site Name]" instead of "Main Page - [Site Name]"?
You should be able to put something like the following in your common.js, and get it to execute on only the Main Page.
if {{{{PAGENAME}}=="Main Page"
{
document.title = "{{SITENAME}}";
}
It's not totally correct because I don't know javascript.
Try editing [[MediaWiki:Pagetitle]] - set it to "{{SITENAME}}" instead of the default "$1 - {{SITENAME}}".
Perhaps you can use MediaWikis parser functions to achieve something like what Adrian Archer answered, but run by the server rather than the client (so search engines will take heed). You'll have to edit [[MediaWiki:Pagetitle]] as Joshua C. Lerner said, then. Extension:ParserFunctions is bundled with MediaWiki 1.18 and above, so http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions will help you!
精彩评论