Sorry, typo, I meant to say you'll need to use global $wgOut;
On Wed, Mar 10, 2010 at 12:47 PM, Tisane . <tisane2718(a)gmail.com> wrote:
Hi Tech Geek,
Probably you'll want to start with
. There are
several different types of extensions, e.g. special page extensions; hook
extensions; tag extensions; etc. If you're making a special page, for
instance, you can find a simple example called myExtension, utilizing four
. There is
a line in the body file you can uncomment/modify to get it to
Remember that if you're getting it to say "Hello world," you won't be
echo("Hello world");, but rather $wgOut->addWikiText("Hello
perhaps $wgOut->addHTML("Hello world"); (although be careful about XSS
issues if you use addHTML), and that you'll need to have put globals $wgOut;
earlier in the function to bring it into scope.
You are on the right track in looking at simple extensions already existent
as preparation for writing your own. I used
to help me figure
out how to write http://www.mediawiki.org/wiki/Extension:RPED
still under development but is being tested at
). I think I also looked
at some of the special pages under includes/specials. Don't forget, when
you're looking up stuff on the Mediawiki site, to check out the categories
and their parent and sister categories, which can often help you find the
documentation and extensions that you're looking for.
When I get SVN access, I'll probably add a "hello world" example extension
for easy download by beginners.
Good luck, -Tisane
On Wed, Mar 10, 2010 at 12:08 PM, Tech Geek <techgeek12345(a)gmail.com>wrote;wrote:
I have been playing with mediawiki for past 6 months and I am getting more
and more comfortable with it and I like it a lot. Now I am thinking to
writing extensions for mediawiki starting from very simple (Hello world
types) extensions. I am familiar with PHP and have done some LAMP based
database driven websites.
Can someone recommend a good source/pointers from where I can start
on how to write extensions? Also I would like to know what is the simplest
extension (based on lines of code) for mediawiki that is currently
so that I can look at the source code and learn from it too.
MediaWiki-l mailing list