Commit 1d588c00 authored by Tobias Haider's avatar Tobias Haider
Browse files

improve namespace formatting in titles to allow {{DISPLAYTITLE:}} with namespaces, fixes #168

parent 742a57c3
......@@ -70,8 +70,8 @@ class TweekiTemplate extends BaseTemplate {
//set 'namespace' and 'title_formatted' variables
$this->data['title_formatted'] = $this->data['title'];
$this->data['namespace'] = str_replace( "_", " ", $this->getSkin()->getTitle()->getNsText() );
if( $this->getSkin()->getTitle()->exists() && $this->data['namespace'] !== '' ) {
$this->data['title_formatted'] = '<span class="namespace">' . $this->data['namespace'] . ":</span> " . $this->getSkin()->getTitle()->getText();
if( strpos( $this->data['title_formatted'], $this->data['namespace'] . ':' ) === 0 ) {
$this->data['title_formatted'] = '<span class="namespace">' . $this->data['namespace'] . ":</span> " . str_replace( $this->data['namespace'] . ':', '', $this->data['title_formatted'] );
}
// Output HTML Page
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment