Difference between revisions of "Dynamic Navigation"

From Organic Design
(New page: == Show/Hide Boxes == Hi Peder, I've a...)
 
Line 1: Line 1:
 
== Show/Hide Boxes ==
 
== Show/Hide Boxes ==
Hi Peder, I've added the DynamicNavigation code from WikiNews front page, it involves three parts:
+
This method is from [[News:Main Page|Wiki News front page]], it involves three parts, CSS styles, JavaScript code and a template, which follow here:
*[[MediaWiki:Common.css]] ''- the CSS styles''
 
*[[MediaWiki:Common.js]] ''- the JavaScript code which extends the DynamicNavigation areas''
 
*[[Template:Dynamic navigation]] ''- The template used to create a DynamicNavigation area''
 
In your wiki the JS and CSS articles contain no other code apart from that required by DynamicNavigation, but when setting it up on a different wiki you may find those articles already populated. If this is the case, just append them with the DynamicNavigation code from the corresponding articles on this wiki. The [[Template:Dynamic navigation|Dynamic navigation template]] contains usage instructions.
 
  
 
{{Dynamic navigation
 
{{Dynamic navigation

Revision as of 01:53, 19 June 2008

Show/Hide Boxes

This method is from [Page|Wiki News front page], it involves three parts, CSS styles, JavaScript code and a template, which follow here:




Language Preference

I've made this quick extension, ExtraMagic, which will add some useful magic words including the current users name, language pref and skin pref. They are accessed with the following magic words:

{{CURRENTUSER}}
{{CURRENTLANG}}
{{CURRENTSKIN}}

If you also install ParserFunctions then you can then do conditional content based on lang pref, for example:

<div class="{{#ifeq:{{CURRENTLANG}}|en|english-example|other-langs}}">

which would give the following for english users

<div class="english-example">

or this for everyone else

<div class="other-langs">