Dear Robert, thanks for your replay. yes, I would like to not make change in core mediawiki files.. so that I ask mediawiki expert how do to do.. I'm very happy because I modified my skin.php using part of your code and now, I can use standard skin.php and skinTemplate.php.
I have got last problem: how modify skin.php to obtain egual to changing like includes/Wiki.php where I modify 'case NS_CATEGORY' so that CategoryPage sections are available only $wgUser->isLoggedIn()
can you help me about it? best, Alessandra.
On Tue, Mar 17, 2009 at 8:04 PM, Robert Carter r.carter@cs.auckland.ac.nz wrote:
It is not a good idea to make changes to these core mediawiki files because it makes upgrading the wiki difficult. This script outputs some '.portlet' html code based on the content of a wiki article (Mediawiki:Nav). You can use this inside Monobook.php or a new skin file of your creation.
<div id='p-page-nav' class="portlet"> <?php global $wgParser, $wgTitle; $side = new Article(Title::newFromText('Nav',NS_MEDIAWIKI)); if (is_object($wgParser)) { $psr = $wgParser; $opt = $wgParser- >mOptions; } else { $psr = new Parser; $opt = NULL; } if (!is_object($opt)) $opt = ParserOptions::newFromUser($wgUser); echo $psr->parse($side->fetchContent(),$wgTitle,$opt,true,true)- >getText(); ?> </div>
Here is a link with some other useful examples: http://organicdesign.co.nz/MediaWiki_code_snippets
Rob
On 17/03/2009, at 10:59 PM, Alessandra wrote:
Hi all,
I created a new wiki skin based loosely on MonoBook coding. I add two new sidebars (one left and one right bar) and original sidebar is now a topbar. New sidebars are used like original sidebar, so I created MediaWiki:leftbar and MediaWiki:rightbar page and I modified:
- includes/Skin.php adding two functions like function buildSidebar()
- includes/SkinTemplate.php adding two line after $tpl->set(
'sidebar', $this->buildSidebar() ); one for each new sidebar
- includes/Wiki.php modifing 'case NS_CATEGORY' so that CategoryPage
sections are available only $wgUser->isLoggedIn()
I would like to release this skin. That is why I ask you if these changing are doable modifing only MonoBook coding or using extensions.
Can you help about it? Best,
-- Alessandra Bilardi
http://genomics.cribi.unipd.it/
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l