A parametrized %WEB macro
This plugin allows to render a link to a web. While linking to a topic is quite
essential to wikis, linking to a web as an object of the wiki isn't that well
supported. Most commonly a link to a web points to the %HOMETOPIC% topic of a
web which serves as the entry point for all of the web. That's what %WEBLINK
does as well. In addition it supports formatting the link in a custom way to
display a more meaningful link text than the normal WebHome text. The %WEBLINK
will be displaying the TopicTitle of the target topic.
Usage
WEBLINK
- create a link to a web
- Syntax:
%WEBLINK{web="..." name="..."}%
- Supported parameters:
Parameter: | Description: | Default: |
"web" | name of the web to link to | BASEWEB |
name="..." | name to display instead of the web name | BASEWEB (its tail in case it is a subweb) |
format="..." | format string for the web link | <a class="webLink $marker" href="$url" title="%ENCODE{"$tooltip" type="html"}%">$title</a> |
marker="..." | string to be inserted into the format string if the web link points to the current web | current |
class="..." | css class used within the web link | webLink |
The following variables can be used in the format string:
- $web: full qualified name of the web to link to
- $topic: name of the topic to link to, defaults to WebHome
- $title: title of the WebHome topic; this is either the topic name or its title
- $name: name of the web, that is the tail of the web specification with all parent webs stripped off
- $url: url for the link
- $marker: the marker set to the "marker" string if the link points to the current web
- $tooltip: tooltip for the link, mostly used in a
title
argument of an anchor
- $summary: web summary as defined in the WEBSUMMARY preference variable
Installation Instructions
You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server.
Open configure, and open the "Extensions" section. "Extensions Operation and Maintenance" Tab -> "Install, Update or Remove extensions" Tab. Click the "Search for Extensions" button.
Enter part of the extension name or description and press search. Select the desired extension(s) and click install. If an extension is already installed, it will
not show up in the
search results.
You can also install from the shell by running the extension installer as the web server user: (Be sure to run as the webserver user, not as root!)
cd /path/to/foswiki
perl tools/extension_installer <NameOfExtension> install
If you have any problems, or if the extension isn't available in
configure
, then you can still install manually from the command-line. See
https://foswiki.org/Support/ManuallyInstallingExtensions for more help.
Dependencies
Name | Version | Description |
---|
Foswiki::Plugins::TopicTitlePlugin | >1.00 | Required for Foswiki < 2.2 |
Change History
26 Jan 2024 |
remove /o flag from regexes |
02 Jun 2018 |
modernized code; depend on new TopicTitlePlugin |
14 Mar 2013 |
removed use of DBCachePlugin |
07 May 2012 |
added web summary as defined in the WEBSUMMARY preference variable |
30 Sep 2011 |
made dependency to Foswiki:Extensions/DBCachePlugin optional |
29 Nov 2010 |
externalized from NatSkinPlugin |