create new tag
, view all tags
ALERT! NOTE: This is a DistributionDocument. Please help maintain high quality documentation: This is a wiki, please fix the documentation if you find errors or incomplete content. Put questions and suggestions concerning the documentation of this topic in the comments section below. Use the Support web for problems you are having using TWiki.

TOPICTITLE -- title of a topic

  • The topic title is defined by, in order of sequence:
    • form field named "Title",
    • topic preference setting named TITLE,
    • topic name.
  • Syntax: %TOPICTITLE% or %TOPICTITLE{ topic="TopicName" }%
  • Supported parameters:
    Parameter: Description: Default:
    "..." or
    Topic to get the title from. Can be of form TopicName or Web.TopicName. Current topic
    encode="html" Encode special characters into HTML entities. If a TOPICTITLE is passed into an HTML form field it should be encoded as "html". Additional encodings: encode="quote", encode="moderate", encode="safe", encode="entity" and encode="url". See ENCODE for details. "" (no encoding)
  • Example: %TOPICTITLE{Projects.SushiProject}% returns Sushi Project assuming the topic has a form field named "Title" with value "Sushi Project"
  • Expands to: VarTOPICTITLE
  • Hint: Write [[+SomeTopicName]] to get the topic title link of a topic, see TWikiEditingShorthand#TopicTitleLinks
  • Category: SystemInformationVariables

Comments & Questions about this Distribution Document Topic


I'm having trouble defining the title of topics. At first I've tried defining a preference Setting named TOPICTITLE, but it only works on the topic. When I try to create a link with [[+TopicName]] or TopicName in the WebHome it doesn't work. Then I tried creating a form template with a formfield with Title as name, and adding this form to the topic. It still doesn't work, neither in the topic or the WebHome.

I would be very appreciated if someone could give me a hand!

Thank you very much

-- Maurici Hervas - 2013-05-16

The [[+TopicName]] and %TOPICTITLE{ topic="TopicName" }% syntax will be available in the upcoming JerusalemRelease. If you want you could try the development TWiki in SVN trunk repository at http://svn.twiki.org/svn/twiki/trunk/

-- Peter Thoeny - 2013-05-16

Thank you for your answer Peter! I found my provisional solution while I wait for the new release, [[TopicName][%FORMFIELD{"Title"}]] and [[$topic][$formfield(Title)]] in a search.

-- Maurici Hervas - 2013-05-24

If I

  * Set TOPICTITLE = Some text
that TOPICTITLE appears in the browser tab (etc).

However, if I

  * Set TITLE = Some text
nothing changes. (reference topic)

I actually prefer to Set TOPICTITLE in a given page, and hope you retain that!

But the docs do say TITLE (I don't like that as much for the Set variable, personally, it's too short and less obvious, although it makes good sense for automagical compatibility with existing apps.

FYI - I've had to go through all of my source files and s/PAGETITLE/TOPICTITLE/. (I've been using a local cover that recognizes a PAGETITLE variable since 2007.)

Hmmmmmm..... I don't suppose you'd consider adding back-end support for PAGETITLE as a recognized alias? For anyone who has ever picked up my code...

-- Vicki Brown - 2014-03-29

I just tested, indeed, this is a bug! It works properly with Title form fiels, but not with TITLE preferences setting. Reading the code, the TITLE variable is supposed to be used, so doc is correct. Could you file a report?

The browser window title (<title> tag) is not yet aware of TOPICTITLE.

TOPICTITLE preferences setting would be more descriptive, but it clashes with TOITCTITLE variable.

In regards to PAGETITLE, why not simple define a preferences setting that redefines it?

-- Peter Thoeny - 2014-03-29

The documentation has not been updated to reference the [[+TopicName]] syntax (which is too sweet to hide!!)


-- Vicki Brown - 2017-04-13

Updated topic with [<nop>[+TopicName]] info.

-- Peter Thoeny - 2018-04-25

Please use the Support forum if you have questions about TWiki features. This comment section is about the documentation of this topic.
Edit | Attach | Watch | Print version | History: r11 < r10 < r9 < r8 < r7 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r11 - 2018-04-25 - PeterThoeny
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.