JDOC

Difference between revisions of "Local wiki extensions"

From Joomla! Documentation

Line 54: Line 54:
  
 
Too add a footnote encose the text in <nowiki><footnote>your footnote entry</footnote></nowiki>. It will automatically appear at the end of the page.
 
Too add a footnote encose the text in <nowiki><footnote>your footnote entry</footnote></nowiki>. It will automatically appear at the end of the page.
 +
: You can not have footnotes '''and''' references on the same page. If both are present, footnotes will take precendence, ignoring the <nowiki><references /></nowiki> tag. This may become an issue on composite documents. As a rule of thumb: don't use these tags on pages that are known to be (frequently) transcluded in other articles.
  
 
===Link Search===
 
===Link Search===

Revision as of 18:13, 17 March 2008

Local wiki templatesLocal wiki extensionsLocal interwiki links

Extensions are additions to the MediaWiki code that perform special functions.

Syntax Highlighting[edit]

The GeSHi syntax-highlighter extension[1] has been installed on this wiki. For PHP code use <source lang="php">Your PHP code here</source>.
For HTML code use <source lang="html4strict">Your HTML markup here</source>.
etc. IF you add an invalid lang name, you'll presented with a list of supported "languages".

For example, inserting the following in your wiki page:

<source lang="php">
<?php
  echo "Hello World\n";
?>
</source>

will result in:

<?php
  echo "Hello World\n";
?>

HTML example:

<html lang="en">
  <head>
  <title>Joomla! Documentation</title>
  <link rel="StyleSheet" href="doccamp.css" type="text/css" media="screen,projection" />
  </head>
  <body class="foo">
  ...
  </body>
</html>

Additional Parser Functions[edit]

The ParserFunctions[2] extension has been added. It provides the following additional parser functions:-

  • #expr: computes simple mathematical expressions;
  • #if: if-then-else construct;
  • #ifeq: compares two strings or numbers;
  • #ifexists: determines if a particular page exists;
  • #ifexpr: evaluates and expression and tests the result;
  • #switch: switch/case statement;
  • #time: time and date formatting function;
  • #rel2abs: converts a relative to an absolute path;
  • #titleparts: extracts parts of a page title.

References and Footnotes[edit]

In your article or tutorial you may want to add external links but they may clutter the text and reduce readability. In order to add a reference[3] enclose the text in a ref element: <ref>your reference entry</ref>. At the end of the page add <references /> to display a list of all ref entries.

Too add a footnote encose the text in <footnote>your footnote entry</footnote>. It will automatically appear at the end of the page.

You can not have footnotes and references on the same page. If both are present, footnotes will take precendence, ignoring the <references /> tag. This may become an issue on composite documents. As a rule of thumb: don't use these tags on pages that are known to be (frequently) transcluded in other articles.

Link Search[edit]

You found a URL used in an article is broken and want to fix it? No problem, hit edit and make the changes. But what if that URL is also used someplace else or in a whole series or pages? The wiki doesn't provide a global search and replace facility and using the standard search function can be tedious and even unsuccessful. Head over to this Special page, type in the bogous URL and find every article that contains the external link: Special:Linksearch


  1. Further information can be found here.
  2. Full documentation for these functions at http://meta.wikimedia.org/wiki/Help:ParserFunctions
  3. don't take a reference literally: it may well be any URL other than Wikipedia or Webster