Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Wikipedia: Wikitech

Extensions form building

 

 

Wikipedia wikitech RSS feed   Index | Next | Previous | View Threaded


linuxloverstaff at gmail

Jul 30, 2012, 5:10 PM

Post #1 of 3 (209 views)
Permalink
Extensions form building

hello,
I'd like to do thinks in the better way...then:

I have to made an extension similar to BoilerTemplate.
Right now I made a special page and I'd like to put in a form to let
user choose a teplate.

Some questions:

1) Must I use some apis to render the form?
2) How to set the form target? Hidden input tags are a good solution
but: how can I have a clean urls ready form?

I'm ready to read any tutorial you can suggest me,
thanks for your attenction,
ADM

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


clement at seizam

Jul 31, 2012, 1:54 AM

Post #2 of 3 (194 views)
Permalink
Re: Extensions form building [In reply to]

Adm <linuxloverstaff <at> gmail.com> writes:

>
> hello,
> I'd like to do thinks in the better way...then:
>
> I have to made an extension similar to BoilerTemplate.
> Right now I made a special page and I'd like to put in a form to let
> user choose a teplate.
>
> Some questions:
>
> 1) Must I use some apis to render the form?
> 2) How to set the form target? Hidden input tags are a good solution
> but: how can I have a clean urls ready form?
>
> I'm ready to read any tutorial you can suggest me,
> thanks for your attenction,
> ADM
>

The HTMLForm Class [1] is very useful to build forms on MW.
It is directly used by most core forms (Preferences, Upload, Block...).
It will most probably suit your needs, if it doesn't, I advise extending it.

There's a documentation [2] and a tutorial [3] on mw.org.

There is also FormSpecialPage [4] extending SpecialPage with build-in HTMLForm.
I never used that, but perhaps it is the abstraction level you're looking for.

I might not understand question 2) very well:
HTMLForm has it's own way to set the target, using
$htmlForm->setTitle($this->getTitle()); #in the case of a SpecialPage.
Targeting another SpecialPage is very complicated, although not impossible.
Targeting the same SpecialPage is probably easier for the developer AND the user.

[1] Path: /includes/HTMLForm.php
[2] Introduction: http://www.mediawiki.org/wiki/HTMLForm
[3] Tutorial: http://www.mediawiki.org/wiki/HTMLForm/tutorial
[4] Path to FormSpecialPage class: /includes/SpecialPage.php

--
Clément Dietschy
Seizam Sàrl.
24, rue de Bâle
68300 Saint-Louis (France)
tél. +33 6 87 75 99 27
www.seizam.com





_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


hashar+wmf at free

Aug 2, 2012, 9:27 AM

Post #3 of 3 (186 views)
Permalink
Re: Extensions form building [In reply to]

Le 31/07/12 10:54, Bedhed a écrit :
> [2] Introduction: http://www.mediawiki.org/wiki/HTMLForm
> [3] Tutorial: http://www.mediawiki.org/wiki/HTMLForm/tutorial

Thanks for sharing those links Clément! I have added them to HTMLForm
class documentation with https://gerrit.wikimedia.org/r/17434


--
Antoine "hashar" Musso


_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Wikipedia wikitech RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.