Example broken: For Safari web browsers, this example is currently broken, probably due recent changes to Extension:SimpleForms.php
This SimpleForms example allows a user to edit any article's talk page dynamically. The talk page is transcluded and a form allows users to enter a heading, their name and a comment which is then dynamically appended to the talk page and the trancluded content updated via an Ajax request. An example of the source code is shown here, it is implemented in Template:BlogComments so it can be transcluded into any article. The layout and formatting of the posted comments is defined in Template:Blog.
== Comments ==
<div id='wgBlogComments'>{{Talk:{{PAGENAMEE}}}}</div>
{{#form:
{{#input:type=hidden|name=content|id=blogContent}}
{{#input:type=hidden|name=title|value=Talk:{{PAGENAMEE}}}}
{{#input:type=hidden|name=summary|id=blogSummary}}
{{#input:type=hidden|name=caction|value=append}}
Heading: {{#input:type=text|id=blogTitle}}
Your name: {{#input:type=text|id=blogName}}
Comment: {{#input:type=textarea|rows=2|id=blogBody}}
{{#input:type=ajax|value=Post comment|update=wgBlogComments|onClick=
var summary='comment posted by '+document.getElementById('blogName').value;
document.getElementById('blogContent').setAttribute('value',
'\n==='+document.getElementById('blogTitle').value+'===\n'+
document.getElementById('blogBody').value+'\n:<i>'+summary+'</i>\n');
document.getElementById('blogSummary').setAttribute('value','Blog '+summary);}}
}}
The submit button looks rather complicated, this is because the content being appended to the talk page needs to be composed by the Javascript from the title, name and body inputs.
2 Comments
2.1 lets comment
do it
--comment posted by Jakub (05:17, 23 September 2007 (NZST))
2.2 lets comment
do it
--comment posted by Jakub (05:17, 23 September 2007 (NZST))
2.3 DynamicPageList Extension Updated
The DynamicPageList extension (DPL) has been upgraded today from version 1.2.0 to 1.2.3. There are a couple of notable changes in this new version.
The first is that %0 can now be used in the DPL include statement which allows the text before the first section and table of contents to be included. This zeroeth section is usually a very useful summary of the entire article and so is a very useful section to be able to render in DPL results.
The second new feature allows the Special:DynamicPageList to render naked results with no edit form which makes it very useful for Ajax forms that use DPL. Currently special pages can't be used in conjunction with action=render, but this functionality will soon be added to SimpleForms since it's also needed for allowing SemanticForms to be used in Wiklets.
The DPL special page isn't much more useful than the sandbox as a user interface to DPL functionality, but is very useful in that it's a simple way of making DPL queries directly via query-string. Here's an example of using Special:DynamicPageList to make a simple query which returns the results without any edit form by adding the noeditbox parameter to the DPL query.