-
Notifications
You must be signed in to change notification settings - Fork 26
dokuwiki api links
This section describes link creation using the basic link functions which are also called from the DokuWiki parser.
Call this function to create an external link. $url gives the URL to link to. $name gives an alternative text to show instead of the link URL itself. Parameter $returnonly is for internal use only in case the function is called by the DokuWiki core/parser and should simply be omitted by plugins.
Call this function to create an internal link. $id gives the page id to link to, e.g. 'wiki:syntax'. $name gives an alternative text to show instead of the page id itself. Parameter $returnonly is for internal use only in case the function is called by the DokuWiki core/parser and should simply be omitted by plugins.
Note: Internallinks are converted to cross-references to pages inside the ODT document if the page to which is linked to is included in the exported document.
Inserts a camel case link. This is the same as calling internallink($link, $link).
Call this function to insert an windows share link. $url gives the URL to link to. $name gives an alternative text to show instead of the link URL itself. Parameter $returnonly is for internal use only in case the function is called by the DokuWiki core/parser and should simply be omitted by plugins. Windows share links are actually rendered as plain text.
Call this function to insert an e-mail link. $address gives the mail address to link to. $name gives an alternative text to show instead of the link URL itself. Parameter $returnonly is for internal use only in case the function is called by the DokuWiki core/parser and should simply be omitted by plugins.
The following code:
$renderer->externallink('https://www.dokuwiki.org/dokuwiki#');
generates an external link to the DokuWiki website.
The following code:
$renderer->externallink('https://www.dokuwiki.org/dokuwiki#', 'DokuWiki');
generates an external link to the DokuWiki website. Instead of the link URL the text "DokuWiki" will be displayed. On hovering the mouse over the text, the link URL will be displayed in a tool tip.
The following code:
$renderer->internallink('start', 'Back to start page.');
generates an internal link to the page start. Instead of the page name the text "Back to start page." will be displayed. If the page is included in the exported ODT document, then the internal link will be converted to a cross-reference. By clicking on it, the user will be forwarded to that page. If the page is not included in the ODT document, then the internal link will be inserted just like an external link.
The following code:
$renderer->emaillink('[email protected]', 'Send a mail to John.');
generates an e-mail link for the mail address [email protected]. Instead of the mail address the text "Send a mail to John." will be displayed. On clicking on the e-mail link, a mail client will be opened to send a mail to "John".
The ODT plugin assigns each external link the style Internet_20_link and the style Visited_20_Internet_20_Link for visited external links. Internal links will use the style Local_20_link and Visited_20_Local_20_Link. If an internal link is referencing a page that is NOT included in the ODT document then it will be rendered using the external link styles.