[Mediawiki-l] Newbie: Adding actions and navigation...

Adam Edwards Adam at always24x7.com
Thu Dec 2 21:24:16 UTC 2004


I'm not sure about your other questions but as to changing the navigation, its not very straight forward.  I created instructions for myself on the steps to add a nav link.

First: In the template/xhtml_slim.pt file add your link.  Search for 'id="p-nav"'.  Copy and past one of the links, everything inside and include the <li></li> tags.  Rename the id to be "n-somethingdifferent" and the href to be {nav_urls/somethingdifferent/href}".  The i18 translate stuff needs to be changed to "string:Title_Of_Wiki_Page" in wiki link format (spaces replaced with underscores).
 
Example: <li id="n-basic_course_outline"><a href="${nav_urls/basiccourseoutline/href" i18n:translate="string:Basic_Course_Outline">Basic Course Outline</a></li>
 
Second:  edit the include/SkinPHPTal.php file.  buildNavUrls function (search for 'function buildNavUrls'), add your new link to the nav_urls array.
for the key, use the 'somethingdifferent' text from the first step in href.  Then in the makel18nUrl call put the title of the Wiki Page, the same as the i18 translate call in the first step.
 
Example: $nav_urls['basiccourseoutline'] = array('href' => htmlspecialchars( $this->makeI18nUrl('Basic_Course_Outline')));
 
Third:  In a browser type this url:  http://yourdomain/wikiroot/index.php/MediaWiki:Wiki_Page_Title where Wiki_Page_Title is your page title for the new link, like ours which is 'Basic_Course_Outline'. That page should be blank, so edit it and add the display title for the linke, ie: Basic Course Outline.  Only that text, which now created a description for the link.  Sometimes adding an &nbsp; to the end of the text in this step will fix a problem where the link gets truncated.  Don't understand this at all.
 
Fourth:  Go to the special pages, and then all system messages.  Edit the Monobook.js page.  add 'ta['n-basic_course_outline'] = new Array( '','Basic Course Outline');', switching out your <li id=".."> and your page name.  Save and you should now have a new nav Link.


-----Original Message-----
From: Muzaffer Ozakca [mailto:mozakca at indiana.edu]
Sent: Thursday, December 02, 2004 3:07 PM
To: mediawiki-l at Wikimedia.org
Subject: [Mediawiki-l] Newbie: Adding actions and navigation...


I have a couple newbie questions, I'm not sure this is the right list,
though.

1. How can I add a new action to the action bar (where edit, discussion,
etc. reside). I think this might require some change in the source code. It
looks like actions are handled in index.php and other pages.

2. How can I add a new item to the navigation panel on the left? I saw posts
about changing a link using Special->All system messages but not quite sure
how to add a new one. Will it require code modification?

3. I also want to add a template feature which somewhat seems harder. Has
anyone done that? What I have in mind is, when a new page is created
(edited), a predefined template will be placed for users to modify. 

Thanks

Muzaffer

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l at Wikimedia.org
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l



More information about the MediaWiki-l mailing list