]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - pgsrc/Help%2FCreatePagePlugin
Update PHP Doc
[SourceForge/phpwiki.git] / pgsrc / Help%2FCreatePagePlugin
1 Date: Fri,  7 Dec 2012 14:58:45 +0000
2 Mime-Version: 1.0 (Produced by PhpWiki 1.4.0)
3 Content-Type: application/x-phpwiki;
4   pagename=Help%2FCreatePagePlugin;
5   flags=PAGE_LOCKED%2CEXTERNAL_PAGE;
6   charset=UTF-8
7 Content-Transfer-Encoding: binary
8
9 The **~CreatePage** [[Help:WikiPlugin|plugin]] allows to easily create new pages, optionally with default content.
10
11 This allows you to create a page geting the new pagename from a
12 forms-based interface, and optionally with the initial content from
13 some template.
14
15 Put a {{{<?plugin-form CreatePage ?>}}} at some page, browse this page,
16 enter the name of the page to create, then click the button.
17
18 == Usage ==
19
20 {{{
21 <?plugin-form CreatePage ?>
22 <?plugin-form CreatePage template=CategoryHomePage ?>
23 <?plugin-form CreatePage template=SomeTemplatePage vars="year=2004&name=None" ?>
24 }}}
25
26 == Arguments ==
27
28 {| class="bordered"
29 |-
30 ! Argument
31 ! Description
32 ! Default value
33 |-
34 | **s**
35 | The pagename, which will passed to the plugin.
36 |
37 |-
38 | **initial_content**
39 | The new page will be pre-filled with this content.
40 |
41 |-
42 | **template**
43 | The new page will be pre-filled with the content of this page.
44 |
45 |-
46 | **vars**
47 | Variables to be expanded.
48 |
49 |-
50 | **overwrite**
51 | Whether to overwrite an existing page.
52 |
53 |}
54
55 == Variable Expansion ==
56
57 The content (either initial_content or template) might hold some variables, which will be
58 expanded on creation. Unassigned variables will stay as %%<var>%%, assigned variables without
59 matching %%<var>%% placeholder will be ignored, without any warning.
60
61 A variable in a template is denoted as ##%%var%%##, which will be expanded by the
62 value of ##var## given to the vars argument (in urlencoded php notation).
63
64 Some special variables are automatically assigned:
65 {| class="bordered"
66 |-
67 | %%ctime%%  || $~WikiTheme->formatDateTime(time())
68 |-
69 | %%author%% || $user->getId()
70 |}
71
72 This forms together with page templates and the [[Help:WikiFormRichPlugin]] and
73 optionally the [[Help:SqlResultPlugin]] a framework to create templated pages.
74
75 == Authors ==
76 * Dan Frankowski
77 * [[Help:Reini Urban|Reini Urban]]
78
79 == Examples ==
80
81 {{{
82 <?plugin-form CreatePage s=MyHomePage ?>
83 }}}
84 <?plugin-form CreatePage s=MyHomePage ?>
85
86 == See Also ==
87 * [[PhpWiki:EasilyCreateNewPages]]
88 * [[Help:WikiFormRichPlugin]]
89 * [[Help:SqlResultPlugin]]
90
91 <noinclude>
92 ----
93 [[PhpWikiDocumentation]] [[CategoryWikiPlugin]]
94 </noinclude>