Knowledge.Departments.IT.WebHome, IT is the WebName
Knowledge.Departments.IT.WebHome has got the TopicTitle "IT Knowledgebase", then the link [[Knowledge.Departments.IT.WebHome]] will render as <a href="/Knowledge/Departments/IT/WebHome">IT Knowledgebase</a>
The TopicTitle is stored in one of these places:
TOPICTITLE_<lang>
TOPICTITLE.
(lang: upper case language code, eg. EN or DE)
If a DataForm does not have a formfield "TopicTitle" or no DataForm at all will the TopicTitle be stored in the preference settingTOPICTITLE.
You may change the name of the formfield being used as a TopicTitle using the TOPICTITLE_FIELD preference setting to this topic. For example,
given you specified a DataForm "SystemForm" with a formfield "SystemName", the set TOPICTITLE_FIELD to "SystemName" to store the TopicTitle in there instead.
Note that in case that the TopicTitle is identical to its TopicName no TOPICTITLE prefrence will be set.
WARNING: When adding, changing or removing a DataForm holding a TopicTitle will it potentially be lost when editing and saving the topic.
There are multiple ways to read the TopicTitle:
%TOPICTITLE%: expands to the preference setting within a topic
%FORMFIELD{"TopicTitle"}%: read the formfield value
%QUERY{"'%TOPIC%'/preferences[name='TOPICTITLE'].value"}%: read the preference setting of a topic
%GETTOPICTITLE{...}%
| Parameters | Description | Default |
|---|---|---|
"..." or topic="..." |
name of the topic to read the title of | current topic |
translate="on/off" |
boolean switch to enable/disable translation of the title, either using Foswiki's internal i18n system or MultiLingualPlugin if installed | off |
rev="..." |
revision of the topic | latest revision |
default="..." |
default string to return in case the topic does not have a TopicTitle | TopicName |
hideautoinc="on/off" |
boolean to suppress a return value in case the TopicName matches ...AUTOINC or ...XXXXXXXXXX |
off |
encode="quotes/url/entity/safe" |
encode the result in the given way. See also VarENCODE |
Sometimes you need to create a proper WikiWord given a free-form text string like the topic title. For example this is the case when creating a new topic based on a given topic title. You then need the "wikified" version if the topic title to be used as the topic name.
Syntax:
%WIKIWORD{"..."}%
"..." or text="..." |
random string, may contain formating tokens such as $percnt and $dollar etc |
Foswiki::Func::getTopicTitle($web, $topic, $rev) for Foswiki versions before 2.2.0. You may also access the
plugin's API directly using Foswiki::Plugins::TopicTitlePlugin::getTopicTitle(...).
This plugin sets the TopicTitleEnabled context flag that may be used in wiki applications depending on this feature. See IfStatements
on how to read the context flags using the %IF makro.
cd /path/to/foswiki perl tools/extension_installer <NameOfExtension> installIf 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.
| Name | Version | Description |
|---|---|---|
| Text::Unidecode | >=1.30 | Required |
| 02 Dec 2024 | adedd WIKIWORD macro |
| 10 Oct 2024 | added translate parameter |
| 17 Jan 2024 | added perl api to set a topic title |
| 05 Mar 2022 | add "safe" encoding mode |
| 01 Apr 2020 | added support for multilingual topic titles |
| 14 Aug 2018 | fixed renaming a topic changing subsequent topics being saved during the same request |
| 28 May 2018 | improved parsing of topic and web parameter |
| 06 Apr 2018 | initial version |