Thanks! Everthing is displayed and working perfectly now ;-)
One thing I do not clearly see is the fact that I had to change sidebar into
casebar in includes/skin.php:
function buildSidebar() {
$fname = 'SkinTemplate::buildSidebar';
wfProfileIn( $fname );
$bar = array();
$lines = explode( "\n", wfMsgForContent( 'casebar' ) );
foreach ($lines as $line) {
if (strpos($line, '*') !== 0)
continue;
if (strpos($line, '**') !== 0) {
$line = trim($line, '* ');
$heading = $line;
} else {
if (strpos($line, '|') !== false) { // sanity check
$line = explode( '|' , trim($line, '* '), 2 );
$link = wfMsgForContent( $line[0] );
if ($link == '-')
continue;
if (wfNoMsg($line[1], $text = wfMsg($line[1])))
$text = $line[1];
if (wfNoMsg($line[0], $link))
$link = $line[0];
$bar[$heading][] = array(
'text' => $text,
'href' => $this->makeInternalOrExternalUrl( $link
),
'id' => 'n-' . strtr($line[1], ' ',
'-'),
);
} else { continue; }
}
}
I had to do this, apparently since no boxes could be displayed because
sidebar does not contain sublevels (it only contains *items and no **items,
while casebar does have **items), but I do not understand quite well why
exactly I had to change this. I guess it has something to do with
f (strpos($line, '**') !== 0) {
$line = trim($line, '* ');
$heading = $line;
but i'm not sure.
In any case, thanks a lot for the help you gave me! I'm really happy it
works now :-)
Birger.
2006/3/29, wilinckx <wilinckx(a)willempen.org>rg>:
On Wed, 29 Mar 2006 11:20:17 +0200
Birger <bweynants(a)gmail.com> wrote:
Thanks a lot for the help! The hierarchical
navigation bar is working
now
;-)
While playing around with the menu, I encountered some strange behavior
though:
1. Whatever I put before the sublevel, is placed automatically above
the navigationbox. For example:
'sidebar' => '
* [[Mainpage|Main Page]]
* [[Special:Recentchanges|Recent Changes]]
* [[Current_events| News]]
* [[Help|Help]]
* Cases
** [[Technicalcase|Tcase]]
** [[Businesscase|Bcase]]
',
MediaWiki puts then the word "Cases" above the navigationbox. I have
tried
to put "*navigation" right above
"* [[Mainpage|Main Page]] " but
unfortunately this does not help. MediaWiki keeps putting the word that
is
placed right above the sublevel above the box.
Why is this done
automatically? How could i possibly change this?
You probably are still having this code:
<h5><?php $out = wfMsg( $bar ); if (wfNoMsg($bar, $out)) echo $bar; else
echo $out; ?></h5>
The $bar variable comes from
<?php foreach ($this->data['sidebar'] as $bar => $cont) { ?>
and $this->data['sidebar'] comes from the old navigation parse system,
which you don't want to use anymore.
What you can do is modify the <h5> line directly, like this:
<h5>The Title I Want To Have Above The Box</h5>
This is not clean at all, but it's easy. If you want to do it more
cleanly you can instead modify the sidebar-parser, which is the function
buildSidebar() in includes/Skin.php
2. I wanted to make a second box beneith
the navigation box and
therefore i had put
<?php $this->msgWiki( 'sidebar' ) ?>
<?php $this->msgWiki( 'casebar' ) ?>
in monobook.php with 'casebar' => '
* Cases
** [[Technicalcase|Tcase]]
** [[Businesscase|Bcase]]
',
Unfortunately, MediaWiki joins the two bars together into one box. Is it
possible to create two separate boxes? I could separate boxes before
(when i
did not apply the
hack<
http://meta.wikimedia.org/wiki/Layout_customization#How_do_I_add_an_editabl…
),
by just putting "*" before the word that had to appear above the box. I
don't see how it is possible to figure that out while applying the
hack...
In HTML code, a box looks like this:
<div class='portlet' id='p-just-on-or-another-id:'>
<h5>The title above the box:</h5>
<div class='pBody'>
here the content of the box
</div>
</div>
In the non-hacked MonoBook, this HTML code is inside a loop, so generated
multiple times if needed.
What you did is this:
<div class='portlet' id='p-just-on-or-another-id:'>
<h5>The title above the box:</h5>
<div class='pBody'>
here the content of the first box
here the content of the second box
</div>
</div>
What you need is this:
<div class='portlet' id='p-just-on-or-another-id:'>
<h5>The title above the first box:</h5>
<div class='pBody'>
here the content of the first box
</div>
</div>
<div class='portlet' id='p-yet-another-id:'>
<h5>The title above the second box:</h5>
<div class='pBody'>
here the content of the second box
</div>
</div>
ps: this is not 100% the exact code of MonoBook, more to give you the
idea. If you can't find out how to change your MonoBook code it's maybe
more usefull to paste the part of the code.
Succes,
Wilinckx.
_______________________________________________
Wikitech-l mailing list
Wikitech-l(a)wikimedia.org
http://mail.wikipedia.org/mailman/listinfo/wikitech-l