Difference between revisions of "User:Nad"

From FollowTheScore
Jump to: navigation, search
(New page: Category:Examples {{news|title=Ajax links|img=|msg= Here's another example of using SimpleForms ajax inputs. This example shows how to use inputs with the...)
 
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[Category:Examples]]
 
{{news|title=Ajax links|img=|msg=
 
Here's another example of using [[MW:Extension:Simple Forms|SimpleForms]] ajax inputs. This example shows how to use inputs with the ''link'' parameter which renders the input as a normal hyperlink which is independent of any form. The link parameter is set to either a URL or an article title. The first two example links below use an article title, the first exists and the second doesn't. The third example has ''link'' set to a relative URL and sends content to be rendered directly without any associated article title.
 
 
Click the links in the second column to dynamically load the result into the third column:
 
 
<table border cellpadding=5 cellspacing=0 width=100% style=text-align:center>
 
<table border cellpadding=5 cellspacing=0 width=100% style=text-align:center>
 
<tr><th>Wikitext</th><th>Rendered&nbsp;link</th><th width=100%>Response</th></tr>
 
<tr><th>Wikitext</th><th>Rendered&nbsp;link</th><th width=100%>Response</th></tr>
Line 9: Line 4:
 
<td><pre style=border:none;background:none;text-align:left;font-size:8pt>
 
<td><pre style=border:none;background:none;text-align:left;font-size:8pt>
 
{{#input: type  = ajax
 
{{#input: type  = ajax
 +
| format = link
 
| update = example1
 
| update = example1
| link  = foo
+
| title  = foo
 
| ONE
 
| ONE
 
}}
 
}}
 
</pre></td>
 
</pre></td>
<td>{{#input:type=ajax|update=example1|link=foo|ONE}}</td>
+
<td>{{#input:type=ajax|format=link|update=example1|title=foo|ONE}}</td>
 
<td><div id=example1>''this is a '''div''' with '''id''' set to '''example1'''''</div></td>
 
<td><div id=example1>''this is a '''div''' with '''id''' set to '''example1'''''</div></td>
 
</tr><tr>
 
</tr><tr>
 
<td><pre style=border:none;background:none;text-align:left;font-size:8pt>
 
<td><pre style=border:none;background:none;text-align:left;font-size:8pt>
 
{{#input: type  = ajax
 
{{#input: type  = ajax
 +
| format = link
 
| update = example2
 
| update = example2
| link  = no-such-article
+
| title  = no-such-article
 
| TWO
 
| TWO
 
}}
 
}}
 
</pre></td>
 
</pre></td>
<td>{{#input:type=ajax|update=example2|link=no-such-article|TWO}}</td>
+
<td>{{#input:type=ajax|format=link|update=example2|title=no-such-article|TWO}}</td>
 
<td><div id=example2>''this is a '''div''' with '''id''' set to '''example2'''''</div></td>
 
<td><div id=example2>''this is a '''div''' with '''id''' set to '''example2'''''</div></td>
 
</tr><tr>
 
</tr><tr>
 
<td><pre style=border:none;background:none;text-align:left;font-size:8pt>
 
<td><pre style=border:none;background:none;text-align:left;font-size:8pt>
{{#input: type   = ajax
+
{{#input: type   = ajax
| update = example3
+
| format  = link
| link  = /wiki/index.php?content=<nowiki>[[foo]]</nowik1>
+
| update = example3
 +
| content = <nowiki>[[foo]]</nowik1>
 
| THREE
 
| THREE
 
}}
 
}}
 
</pre></td>
 
</pre></td>
<td>{{#input:type=ajax|update=example3|link=/wiki/index.php?content=<nowiki>[[foo]]</nowiki>|THREE}}</td>
+
<td>{{#input:type=ajax|format=link|update=example3|content=<nowiki>[[foo]]</nowiki>|THREE}}</td>
 
<td><div id=example3>''this is a '''div''' with '''id''' set to '''example3'''''</div></td>
 
<td><div id=example3>''this is a '''div''' with '''id''' set to '''example3'''''</div></td>
 
</tr>
 
</tr>
 
</table>
 
</table>
 +
 +
{{#form:
 +
 +
{{#input: type  = hidden
 +
| name  = content
 +
| value  = <nowiki> {{#dpl:category={{#request:cat}}}} </nowiki>
 +
}}
 +
 +
{{#input: type  = select
 +
| name  = cat
 +
| *Select category {{#dpl: namespace = Category | format = ,\n*%TITLE%,, }}
 +
}}
 +
 +
{{#input: type  = ajax
 +
| value  = List members
 +
| update = listcat-result
 +
}}
 +
 +
<div id="listcat-result">''No results to display...''</div>
 
}}
 
}}

Latest revision as of 23:03, 22 October 2007

WikitextRendered linkResponse
{{#input: type   = ajax
	| format = link
	| update = example1
	| title  = foo
	| ONE
}}
{{#input:type=ajax|format=link|update=example1|title=foo|ONE}}
this is a div with id set to example1
{{#input: type   = ajax
	| format = link
	| update = example2
	| title  = no-such-article
	| TWO
}}
{{#input:type=ajax|format=link|update=example2|title=no-such-article|TWO}}
this is a div with id set to example2
{{#input: type    = ajax
	| format  = link
	| update  = example3
	| content = <nowiki>[[foo]]</nowik1>
	| THREE
}}
{{#input:type=ajax|format=link|update=example3|content=[[foo]]|THREE}}
this is a div with id set to example3

{{#form:

{{#input: type = hidden | name = content | value = {{#dpl:category={{#request:cat}}}} }}

{{#input: type = select | name = cat | *Select category

  • AT&
  • AT&T
  • African Union member states
  • Another Topic
  • Antwerpen
  • Apachetest
  • Belgium
  • Bruxelles
  • Café
  • Café d'Anvers
  • Calendar Templates
  • Car
  • Cat 1
  • Cat 11
  • Cat 12
  • Cat 2
  • Cat d'Test
  • Category
  • Cities
  • Class
  • Countries
  • Country
  • CountryA
  • CountryB
  • DPL
  • DPL Example
  • DPL Example 007 main cat
  • DPL Example 007 sub cat 1
  • DPL Example 007 sub cat 2
  • DPL Manual
  • DPL bugs
  • DocType
  • DocTypeForm
  • DocTypeScript
  • Dpl group's event
  • Dynasty
  • Events
  • Execute
  • Expressionism
  • Fictitious country
  • Frankfurt
  • Freshman
  • Game
  • Germany
  • Hamburg
  • Impressionism
  • Issue
  • List templates
  • Location
  • MainCat
  • Manual
  • Michael's evens
  • Michael's events
  • Munich
  • Musical Instrument
  • North Africa
  • Painter
  • Person
  • Place
  • Plan
  • Schnittstellen
  • Smdemo
  • Some Topic
  • Stachoo test
  • Step
  • Student
  • SubCat 1
  • SubCat 10
  • SubCat 11
  • SubCat 12
  • SubCat 13
  • SubCat 14
  • SubCat 2
  • SubCat 3
  • SubCat 4
  • SubCat 5
  • SubCat 6
  • SubCat 7
  • SubCat 8
  • SubCat 9
  • Subcats
  • Subcats 1
  • Subcats 2a
  • Subcats 2b
  • Subcats 2c
  • Subcats 3a1
  • Subcats 3a2
  • Subcats 3b1
  • Subcats 3b2
  • Subject
  • Sudan
  • TableBug
  • Test
  • Test'd funk
  • Test-1
  • Test3000
  • Test3001
  • Test3002
  • Test 1
  • Test Images
  • Test categories
  • TopVolkoV
  • Topic groups
  • Town
  • Trip
  • Type
  • Vehicle
  • VolkoV
  • Wgraph
  • Wgraph Manual
  • Whatlinksheretest

}}

{{#input: type = ajax | value = List members | update = listcat-result }}

No results to display...

}}