Feature Proposals » Topic title handler

Summary

Current State: Developer: Reason: Date: Concerns By: Bug Tracking: Proposed For:
MergedToCore HideyoImazu AcceptedByReleaseMeeting 2015年09月11日 TWikibug:Item7689 KampalaRelease

Edit Form

CurrentState:
ReasonForDecision:
DateOfCommitment: Format: YYYY-MM-DD
ProposedFor:

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日

Edit | Attach | (削除) Watch (削除ここまで) | Print version | History : r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2015年10月01日 - HideyoImazu
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-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.

AltStyle によって変換されたページ (->オリジナル) /