Create a gist now

Instantly share code, notes, and snippets.

Add entry's title for edit entry screen.
callbacks:
MT::App::CMS::template_param.edit_entry: >
sub {
my ( $cb, $app, $param, $tmpl ) = @_;
if ( $param->{ id } ) {
my $title_tags = $tmpl->getElementsByName( 'page_title' );
for my $tag ( @$title_tags ) {
my $value = $tag->getAttribute( 'value' );
my $title = $param->{ title };
$title = MT::Util::encode_html( $title ) if $title;
$title = MT->translate( 'Untitled' ) unless $title;
$title .= ' - ' . $value;
$tag->setAttribute( 'value', $title );
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment