Last modified: 2010-05-15 15:37:24 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T5062, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 3062 - Flexible Sidebar Management
Flexible Sidebar Management
Status: RESOLVED WORKSFORME
Product: MediaWiki
Classification: Unclassified
Interface (Other open bugs)
1.5.x
All All
: Normal enhancement with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-08-06 16:05 UTC by Fabian Zeindl
Modified: 2010-05-15 15:37 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Fabian Zeindl 2005-08-06 16:05:33 UTC
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";
   }
                                                                               
                                                  
 ?>
Comment 1 Rob Church 2006-04-04 09:52:27 UTC
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.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links