[cvs] [Wiki] changed: RuleInterwiki
Jan Schneider
jan at horde.org
Mon Aug 16 02:03:30 PDT 2004
jan Mon, 16 Aug 2004 02:03:30 -0700
Modified page: http://wiki.horde.org/display.php?page=RuleInterwiki
New Revision: 1.1
@@ -1,6 +1,4 @@
-+ {{interwiki}}
-
[[toc]]
++ About This Rule
@@ -8,30 +6,37 @@
|| **Type** || inline ||
|| **Syntax** normal || {{``SiteName:PageName``}} ||
|| **Syntax** described || {{[``SiteName:PageName`` Show this text instead]}} ||
-++ Configuration Values
+++ Parse Configuration Keys
+
+None.
+
+++ Render Configuration Keys
+
+|| **Format** || **Key** || **Type** || **Description** ||
+|| {{Xhtml}} || {{sites}} || array || An array of key-value pairs where the key is the text of the interwiki site name and the value is the URL for that site ||
+|| {{Xhtml}} || {{target}} || string || The HREF target for interwiki links; e.g., '_blank' ||
-|| **Name** || **Type** || **Description** ||
-|| {{sites}} || array || An array of key-value pairs where the key is the text of the interwiki site name and the value is the URL for that site ||
++ Description
Interwiki is a way of representing wiki pages on other wikis. To mark an interwiki link, type the name of the site, a colon, then the name of the page on the interwiki site.
-Text_Wiki needs to know the URL for the various interwiki sites so it make clickable links; to tell Text_Wiki the site names and urls, use the {{setRuleConf()}} method. The array key should be the name of the site, and the array value should be the URL part leading up to the page-value.
+Text_Wiki needs to know the URL for the various interwiki sites so it make clickable links; to tell Text_Wiki the site names and urls, use the {{[MethodSetRenderConf setRenderConf()]}} method. The array key should be the name of the site, and the array value should be the URL part leading up to the page-value.
-<php>
+<code type="php">
// [snip] create a Text_Wiki object called $wiki
// set up an array of interwiki site names and urls
$sites = array(
- 'ExampleWiki' => 'http://example.com/view.php?page=';
- 'MeatBall' => 'http://www.usemod.com/cgi-bin/mb.pl?',
- 'Advogato' => 'http://advogato.org/',
- 'Wiki' => 'http://c2.com/cgi/wiki?'
+ 'MeatBall' => 'http://www.usemod.com/cgi-bin/mb.pl?%s',
+ 'Advogato' => 'http://advogato.org/%s',
+ 'Wiki' => 'http://c2.com/cgi/wiki?%s'
);
// configure the interwiki rule
-$wiki->setRuleConf('interwiki', 'sites', $sites);
-</php>
+$wiki->setRenderConf('xhtml', 'interwiki', 'sites', $sites);
+</code>
+
+> **Note:** Note the use of %s in the above URL strings; the %s will be replaced by the page name. If you specify a string that does not have a %s in it, Text_Wiki will assume that the page name should go at the very end of the string.
More information about the cvs
mailing list