A lot of our documentation involves names which typically have underscores in them, so the displaying of a space instead just adds unneeded confusion. Converting spaces to underscores is fine as-is. But for underscores in the page name, is there a way to simply display it normally without the conversion?
I've searched a bit and found various posts from others asking how to change the way underscores are converted to spaces, but I haven't seen much in the way of a solid workaround. Also, most people seem to just want to change the separator from an underscore to another character. I don't care about that, though... I just care about how it's displayed.
Can anyone help me on this one?
---Kevin
You can create a simple extension which is a hook.
Copy/paste this code in a new php script (e.g. getPageTitle.php) in extensions directory.
<?php $wgHooks['GetPageTitle'][] = 'nicePageTitle';
function nicePageTitle($pagetitle) { #TEST : $pagetitle = strtoupper($pagetitle); $pagetitle = str_replace(' ', '_', $pagetitle); } ?>
and in your LocalSettings.php add near the end include('extensions/getPageTitle.php');
In includes/OutputPage.php, locate the function getPageTitle in OutputPage class. Replace it by :
function getPageTitle() { wfRunHooks( 'GetPageTitle', array(&$this->mPagetitle )); return $this->mPagetitle; }
Works on my MW 1.6.7
2006/7/5, K. Fairchild kfairchild@stenbarr.com:
A lot of our documentation involves names which typically have underscores in them, so the displaying of a space instead just adds unneeded confusion. Converting spaces to underscores is fine as-is. But for underscores in the page name, is there a way to simply display it normally without the conversion?
I've searched a bit and found various posts from others asking how to change the way underscores are converted to spaces, but I haven't seen much in the way of a solid workaround. Also, most people seem to just want to change the separator from an underscore to another character. I don't care about that, though... I just care about how it's displayed.
Can anyone help me on this one?
---Kevin
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org