Difference between revisions of "DPL Example 029"
(6 intermediate revisions by the same user not shown) | |||
Line 13: | Line 13: | ||
If called from a wiki page one would probably use a form like this: | If called from a wiki page one would probably use a form like this: | ||
+ | ---- | ||
+ | {{#form: action={{SCRIPTPATH}}/index.php | ||
+ | |{{#input: type=hidden | name=title | value=Template:Set Template Parameter }} | ||
+ | in page {{#input: name=DPL_arg1 | size=30 | value=DPL Example 029/DummyPage }} | ||
+ | and template {{#input: name=DPL_arg2 | value=DummyTemplate }} | ||
+ | change parameter {{#input: name=DPL_arg3 | value= parameter 1 }} | ||
+ | to value {{#input: name=DPL_arg4 | value= new value }}<br> | ||
+ | {{#input: type=submit | value=replace }} | ||
+ | }} | ||
− | + | The update will not be done because we did not specify "&DPL_arg5=yes" in the action URL. | |
+ | |||
+ | ---- | ||
Calling the URL could look like this: | Calling the URL could look like this: | ||
− | [http://{{SERVERNAME}}{{SCRIPTPATH}}index.php?title=Template: | + | [http://{{SERVERNAME}}{{SCRIPTPATH}}/index.php?title=Template:Set_Template_Parameter&DPL_arg1=DPL_Example_029/DummyPage&DPL_arg2=DummyTemplate&DPL_arg3=parameter+1&DPL_arg4=new+value click to simulate change] |
+ | |||
+ | You will see the wiki source of [[DPL Example 029/DummyPage]]. It contains a call of Template [[Template:DummyTemplate]]. The call contains two parameters, values are "something" and "something else". You will see that the value of the first parameter has been changed to "new value". | ||
+ | |||
+ | The update will not be done because we did not specify "&DPL_arg5=yes" in the URL. |
Latest revision as of 10:00, 25 June 2009
back to list of examples
Change the value of a template parameter in a certain page
We defined a DPL based template which takes 4 parameters:
- a page name
- a template name
- a parameter name
- a value for that parameter
- a control parameter
Using this template you can modify a page.
The template can either be called from within a wiki page or via the command line.
If called from a wiki page one would probably use a form like this:
{{#form: action=/dpldemo/index.php
|{{#input: type=hidden | name=title | value=Template:Set Template Parameter }}
in page {{#input: name=DPL_arg1 | size=30 | value=DPL Example 029/DummyPage }}
and template {{#input: name=DPL_arg2 | value=DummyTemplate }}
change parameter {{#input: name=DPL_arg3 | value= parameter 1 }}
to value {{#input: name=DPL_arg4 | value= new value }}
{{#input: type=submit | value=replace }}
}}
The update will not be done because we did not specify "&DPL_arg5=yes" in the action URL.
Calling the URL could look like this:
You will see the wiki source of DPL Example 029/DummyPage. It contains a call of Template Template:DummyTemplate. The call contains two parameters, values are "something" and "something else". You will see that the value of the first parameter has been changed to "new value".
The update will not be done because we did not specify "&DPL_arg5=yes" in the URL.