Dear list :)
On one of my wikis, every single bit of data submitted from the users must be formatted the same way. It's like, for instance, people submitting their business cards. Each much have a name, an address, a telephone number.
Therefore, to make the whole wiki consistent, i made a template that formats all this data into a pretty page. Each content page then just have to call the template like:
{{bizcard| |name=John Doe |Numer=555-1212 }}
This is all good and dandy, except I have no way to enforce that. When users create new pages, they get a blank sheet and forget all about the templates. Or they might think about the template, but forget half the required fields.
So my question, in all its glory to this list is, is there a way to at the very least pre-laod content into the "create new page" page so that a blank template could be already in the face of the user, all that he/she would need to do is to fill the blanks?
Best regards, Laurent Chouinard
http://meta.wikimedia.org/wiki/Help:Inputbox ?
bye Marco
----- Original Message ----- From: "laurent" laurent@sem.ca To: mediawiki-l@Wikimedia.org Sent: Wednesday, June 14, 2006 2:17 PM Subject: [Mediawiki-l] Automatic template
Dear list :)
On one of my wikis, every single bit of data submitted from the users must be formatted the same way. It's like, for instance, people submitting their business cards. Each much have a name, an address, a telephone number.
Therefore, to make the whole wiki consistent, i made a template that formats all this data into a pretty page. Each content page then just have to call the template like:
{{bizcard| |name=John Doe |Numer=555-1212 }}
This is all good and dandy, except I have no way to enforce that. When users create new pages, they get a blank sheet and forget all about the templates. Or they might think about the template, but forget half the required fields.
So my question, in all its glory to this list is, is there a way to at the very least pre-laod content into the "create new page" page so that a blank template could be already in the face of the user, all that he/she would need to do is to fill the blanks?
Best regards, Laurent Chouinard _______________________________________________ MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Marco Rota wrote:
That's close, but not quite it. As I understand, this Inputbox extension allows the reading of one textbox, and then applies its content to either name a new page creation, add comments, or search. I love the idea, and i'll probably implement this for searching and for comments addition. Unfortunately, it only uses one box, so I can't put like 20 of these with one "Submit" button that would mash it all up and create one page with the 20 fields...
Thanks for the tip though.
Laurent
...As I understand, this Inputbox extension > allows the reading of one textbox, and then applies its content to > either name a new page creation,...Yes, it's true but you can preload a template.<inputbox>
type=create preload=Template:Mytemplate </inputbox>
----- Original Message ----- From: "laurent" laurent@sem.ca To: "MediaWiki announcements and site admin list" mediawiki-l@Wikimedia.org Sent: Wednesday, June 14, 2006 2:30 PM Subject: Re: [Mediawiki-l] Automatic template
Marco Rota wrote:
That's close, but not quite it. As I understand, this Inputbox extension allows the reading of one textbox, and then applies its content to either name a new page creation, add comments, or search. I love the idea, and i'll probably implement this for searching and for comments addition. Unfortunately, it only uses one box, so I can't put like 20 of these with one "Submit" button that would mash it all up and create one page with the 20 fields...
Thanks for the tip though.
Laurent _______________________________________________ MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
...As I understand, this Inputbox extension > allows the reading of one textbox, and then applies its content to > either name a new page creation,...
Yes, it's true but you can preload a template.
<inputbox> type=create preload=Template:Mytemplate </inputbox>
----- Original Message ----- From: "Marco Rota" marcor@sorint.it To: "MediaWiki announcements and site admin list" mediawiki-l@Wikimedia.org Sent: Wednesday, June 14, 2006 2:53 PM Subject: Re: [Mediawiki-l] Automatic template
...As I understand, this Inputbox extension > allows the reading of one textbox, and then applies its content to > either name a new page creation,...Yes, it's true but you can preload a template.<inputbox>
type=create preload=Template:Mytemplate
</inputbox>
----- Original Message ----- From: "laurent" laurent@sem.ca To: "MediaWiki announcements and site admin list" mediawiki-l@Wikimedia.org Sent: Wednesday, June 14, 2006 2:30 PM Subject: Re: [Mediawiki-l] Automatic template
Marco Rota wrote:
That's close, but not quite it. As I understand, this Inputbox extension allows the reading of one textbox, and then applies its content to either name a new page creation, add comments, or search. I love the idea, and i'll probably implement this for searching and for comments addition. Unfortunately, it only uses one box, so I can't put like 20 of these with one "Submit" button that would mash it all up and create one page with the 20 fields...
Thanks for the tip though.
Laurent _______________________________________________ MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
laurent wrote:
Marco Rota wrote:
That's close, but not quite it. As I understand, this Inputbox extension allows the reading of one textbox, and then applies its content to either name a new page creation, add comments, or search. I love the idea, and i'll probably implement this for searching and for comments addition. Unfortunately, it only uses one box, so I can't put like 20 of these with one "Submit" button that would mash it all up and create one page with the 20 fields...
Thanks for the tip though.
Laurent
You can create "Template:Initial page" which includes the content of the page when just created, and "Template:Initial page instructions" which includes instructions above the editing area, then you can edit Linker::makeBrokenLinkObj (includes/Linker.php) and replace both "action=edit" with "action=edit&preload=Template:Initial_page&editintro=Template:Initial_page_instructions". It should work then in every broken link shown, even to talk pages, but you can check "!$title->isTalkPage()", or even better "$title->getNamespace() == NS_MAIN", then add these parts only if true. For example, the original code is:
if ( '' == $query ) { $q = 'action=edit'; } else { $q = 'action=edit&'.$query; } $u = $nt->escapeLocalURL( $q );
You can replace it with:
$q2 = ($title->getNamespace() == "NS_MAIN") ? '&preload=Template:Initial_page&editintro=Template:Initial_page_instructions' : ''; if ( '' == $query ) { $q = 'action=edit'.$q2; } else { $q = 'action=edit'.$q2.'&'.$query; } $u = $nt->escapeLocalURL( $q );
Please note that you have to re-insert the code in every time updating the MediaWiki system. Alternatively, you can create a new hook, something like:
wfRunHooks( 'BrokenLinkQuery', array( &$query, &$title ) ); if ( '' == $query ) { $q = 'action=edit'; } else { $q = 'action=edit&'.$query; } $u = $nt->escapeLocalURL( $q );
and add in LocalSettings.php something like:
$wgHooks['BrokenLinkQuery'][] = 'AddEditParameters'; function AddEditParameters ( $query, $title ) { if ($title->getNamespace() == "NS_MAIN") { $q = 'preload=Template:Initial_page&editintro=Template:Initial_page_instructions'; if ( '' == $query ) { $query = $q; } else { $query = $q.'&'.$query; } } }
Then you should re-add only the single line of the hook when upgrading the code, instead of copying a whole piece of code.
I haven't checked all of these codes, so they may produce errors.
All of the example codes will add parameters to broken links, and should the preloaded content and the edit instructions only when editing new pages in the main namespace.
- -- #define Name RotemLiss #define Mail mailSTRUDELrotemlissDOTcom #define Site www.rotemliss.com
#define KeyFingerPrint 4AFD 8579 A449 4267 BED9 38E5 6EF8 5B1F EBDE 7AC0
On 14/06/06, laurent laurent@sem.ca wrote:
So my question, in all its glory to this list is, is there a way to at the very least pre-laod content into the "create new page" page so that a blank template could be already in the face of the user, all that he/she would need to do is to fill the blanks?
You have a few options.
1. Install the InputBox extension and use its preload parameters. 2. Ask users to create pages via an edit link with the preload parameter set. 3. Hook the edit form and preload content into the textbox.
For an example of #3, see the Preloader extension in Subversion, at http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/Preloader. You'll need to patch includes/EditForm.php to add a new hook (see the readme file).
Rob Church
mediawiki-l@lists.wikimedia.org