Difference between revisions of "Template:Dynamic navigation"

From Organic Design wiki
(New page: == Show/Hide Boxes == Hi Peder, I've a...)
 
Line 1: Line 1:
== Show/Hide Boxes ==
+
<div style="clear:both;text-align:center;{{#if:{{{WIDTH|}}}|width:{{{WIDTH}}}| }};margin:auto;"  align="center" class="NavFrame {{{EXT|}}}">
Hi Peder, I've added the DynamicNavigation code from WikiNews front page, it involves three parts:
+
<div class="NavHead" style="clear:both;text-align:center;background:{{{BGCOLOR}}};">{{{TITLE}}}</div>
*[[MediaWiki:Common.css]] ''- the CSS styles''
+
<div class="NavContent" style="clear:both;text-align:left;">
*[[MediaWiki:Common.js]] ''- the JavaScript code which extends the DynamicNavigation areas''
+
{{{CONTENT}}}
*[[Template:Dynamic navigation]] ''- The template used to create a DynamicNavigation area''
+
</div>
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.
+
<div class="NavContent" style="clear:both;font-size: 90%;text-align:left;">
 
+
{{{SMALLCONTENT|}}}
{{Dynamic navigation
+
</div>
|BGCOLOR=#ffcccc
+
</div>
|TITLE=January
+
<noinclude><pre>Parameter:
|CONTENT={{#calendar:month=Jan}}
+
  BGCOLOR = colour of the heading of the navigation box
|SMALLCONTENT=
+
  TITLE  = heading of the navigation box
|EXT=NavOnce
+
  CONTENT = contents of the navigation box.  Use <nowiki>&amp;#124;</nowiki> to separate links.
}}
+
            It is not possible to include a pipe ("|") in the contents
 
+
            as this symbol is used to separate parameters.
 
+
  SMALLCONTENT = OPTIONAL. as per CONTENT but produces 90% fontsize
{{Dynamic navigation
+
  WIDTH  = Optional parameter to limit width
|BGCOLOR=#ccffcc
+
  EXT    = Optional extentions [space seperated list. case-sensitive] so far only NavOnce
|TITLE=February
+
      EXT=NavOnce    =   only allow one navbox with this extention visible at a time (closes other one's)</pre>
|CONTENT={{#calendar:month=Mar}}
+
</noinclude>
|SMALLCONTENT=
 
|EXT=NavOnce
 
}}
 
 
 
 
 
{{Dynamic navigation
 
|BGCOLOR=#ccccff
 
|TITLE=March
 
|CONTENT={{#calendar:month=Mar}}
 
|SMALLCONTENT=
 
|EXT=NavOnce
 
}}
 
 
 
== Language Preference ==
 
I've made this quick extension, [[OD:Extension:ExtraMagic.php|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:
 
<pre>
 
{{CURRENTUSER}}
 
{{CURRENTLANG}}
 
{{CURRENTSKIN}}
 
</pre>
 
 
 
If you also install [[MW:Extension:ParserFunctions|ParserFunctions]] then you can then do conditional content based on lang pref, for example:
 
<pre>
 
<div class="{{#ifeq:{{CURRENTLANG}}|en|english-example|other-langs}}">
 
</pre>
 
 
 
which would give the following for english users
 
<pre>
 
<div class="english-example">
 
</pre>
 
 
 
or this for everyone else
 
<pre>
 
<div class="other-langs">
 
</pre>
 

Revision as of 01:51, 19 June 2008

Parameter:
  BGCOLOR = colour of the heading of the navigation box
  TITLE   = heading of the navigation box
  CONTENT = contents of the navigation box.  Use &#124; to separate links.
            It is not possible to include a pipe ("|") in the contents
            as this symbol is used to separate parameters.
  SMALLCONTENT = OPTIONAL. as per CONTENT but produces 90% fontsize
  WIDTH   = Optional parameter to limit width
  EXT     = Optional extentions [space seperated list. case-sensitive] so far only NavOnce
      EXT=NavOnce    =    only allow one navbox with this extention visible at a time (closes other one's)