Page MenuHomePhabricator

Flexible Sidebar Management
Closed, DeclinedPublic

Description

Author: fabian.zeindl

Description:
With this patch you can create MediaWiki:CustomNavBlocks and list several other
MediaWiki: Articles there. Each article represents a block, so in my
MediaWiki:CustomNavBlocks I have:

CustomBlockNavigation
CustomBlockMyOwnBlock
CustomBlockAnotherOne

MediaWiki:CustomBlockNavigation is a simple Wikipage with a list of links
(mainpage etc.).
My script reads this, and displays the links in a box with the title
"Navigation" (it cuts the 11 chars: "CustomBlock").

Replace this in Monobook.php:

<?php foreach ($this->data['sidebar'] as $bar => $cont) { ?>

<div class='portlet' id='p-<?php echo htmlspecialchars($bar) ?>'>
  <h5><?php $this->msg( $bar ) ?></h5>
  <div class='pBody'>
   <ul>
   <?php foreach($cont as $key => $val) { ?>
   <li id="<?php echo htmlspecialchars($val['id']) ?>"><a href="<?php echo

htmlspecialchars($val['href']) ?>"><?php echo
htmlspecialchars($val['text'])?></a></li>

   <?php } ?>
   </ul>
  </div>
</div>

<?php } ?>

with:

<?php include ('MyIncludes/customnavblocks.php');?>

<mediawikiinstallation>/MyIncludes/customnavblocks.php:

<?php

$text = $this->translator->translate( 'CustomNavBlocks' );
$customblocks = explode ("\n", $text);

while(list($iarg, $ival) = each($customblocks))     {

  echo "\n<div class=\"portlet\" id=\"" . substr($ival,11,strlen($ival)) .

"\">\n";

  echo "  <h5>" . substr($ival,11,strlen($ival)) . "</h5>\n";
  echo "  <div class=\"pBody\">\n";
  echo "  " . $this->msgWiki($ival);
  echo "  </div>\n";
  echo "</div>\n";
}

?>


Version: 1.5.x
Severity: enhancement

Details

Reference
bz3062

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 8:46 PM
bzimport set Reference to bz3062.
bzimport added a subscriber: Unknown Object (MLST).

robchur wrote:

If I read the intent right, and I think I did, then "extra boxes" can be made by
starting another first-level bulleted item in MediaWiki:Sidebar.