[Mediawiki-l] Re: Modifying MediaWiki
Ashar Voultoiz
hashar at altern.org
Thu Aug 4 19:41:56 UTC 2005
Joel Konkle-Parker wrote:
<snip>
> 1. I'd like to programmatically change the displayed page title to something
> other than the title stored in the database. That is, if a user navigates to
> index.php?title=foo, the resulting page will be titled "bar" (in the <h1> at
> the top of the page).
You can make an extension that implements a new tag (ex: <pagetitle>)
then the extension set the page title:
$wgOut->setPagetitle( 'new title' );
> 2. I'd like to pre-populate the edit box for all empty pages with a certain
> template text. That is, if a user tries to create a new page, the resulting
> edit box will already be filled with some text (supplied by me).
You can probably hack EditPage::Editform . There is a test that show the
messages 'editintro' and 'newarticletext'. You can probably add a
default text from there.
The test is:
if( !$this->mTitle->getArticleID() &&
('initial' == $formtype || $firsttime ))
{ # new article
..
cheers,
--
Ashar Voultoiz - WP++++
http://en.wikipedia.org/wiki/User:Hashar
http://www.livejournal.com/community/wikitech/
IM: hashar at jabber.org ICQ: 15325080
More information about the MediaWiki-l
mailing list