Motivation
A plugin may want to specify a topic title.
Description and Documentation
If a plugin has topicTitleHandler() function defined, it's called from TWiki::Meta::topicTitle().
If there are multiple plugins having topicTItleHandler(), the first one returning true value takes effect.
Examples
TWiki::Meta
...
sub topicTitle {
...
my $session = $this->{_session};
my $title;
$session->{plugins}->dispatch('topicTitleHandler', $session, $this->{_web}, $this->{_topic}, \$title);
return $title if ( defined($title) );
...
}
...
TWiki::Plugins
my %onlyOnceHandlers =
{
...
topicTitleHandler => 1,
...
};
TWiki::Plugins::ARandomPlugin
...
sub topicTitleHandler {
my ($session, $web, $topic, $ref) = @_;
...
# if a topic title is not determined
# not setting $$ref
return 0;
...
# if a topic title is determined by the handlr
$$ref = "Some topic title";
return 1;
}
...
Impact
Implementation
--
Contributors:
Hideyo Imazu - 2015-09-11
Discussion
Logical enhancement, with good separation for those who need this.
--
Peter Thoeny - 2015-09-11