Tags:
create new tag
, view all tags

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

TopicSummary:
CurrentState:
CommittedDeveloper:
ReasonForDecision:
DateOfCommitment:   Format: YYYY-MM-DD
ConcernRaisedBy:
BugTracking:
OutstandingIssues:
RelatedTopics:
InterestedParties:
ProposedFor:
TWikiContributors:
 

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
 
  • 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-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.