Diff: Help/CreatePagePlugin

Differences between current version and predecessor to the previous major change of Help/CreatePagePlugin.

Other diffs: Previous Revision, Previous Author

Newer page: version 6 Last edited on 17 January 2022 3:00 by harold
Older page: version 5 Last edited on 9 September 2007 0:16 by harold Revert
@@ -1,64 +1,85 @@
-Help:WikiPlugin to easily create new pages, optionally with default content. Since v1.3.8  
+The **~CreatePage** [[ Help:WikiPlugin|plugin]] allows to easily create new pages,  
+ optionally with default content. 
  
-This allows you to create a page geting the new pagename from a  
-forms-based interface, and optionally with the initial content from  
- some template. 
+This allows you to create a page getting the new pagename from a  
+forms-based interface, and optionally with the initial content from some template. 
  
-Put a " <~ ?plugin-form ~ CreatePage ?~ >" at some page, browse this page, 
+Put a {{{ <?plugin-form CreatePage ?>}}} at some page, browse this page, 
 enter the name of the page to create, then click the button. 
  
-!! Usage  
-<verbatim>  
- <?plugin-form CreatePage ?>  
- <?plugin-form CreatePage template =CategoryHomePage ?>  
- <?plugin-form CreatePage template =SomeTemplatePage vars="year =2004&name =None" ?>  
-</verbatim>  
+== Usage == 
  
-!! Plugin Arguments  
-*s*: |  
- The pagename, which will passed to the plugin. Default: ""  
-*initial_content*: |  
- The new page will be pre -filled with this content. Default: ""  
-* template*: |  
- The new page will be pre -filled with the content of this page. Default: ""  
-* vars*: |  
- variables to be expanded. Default: ""  
-*overwrite*: |  
- Whether to overwrite an existing page. Default: ""  
+{{{  
+<?plugin-form CreatePage ?>  
+<? plugin-form CreatePage template=CategoryHomePage ?>  
+<?plugin -form CreatePage template=SomeTemplatePage vars= "year=2004&name=None " ?>  
+}}}  
  
-!! Known Problems  
+== Arguments ==  
  
-None  
+{| class="bordered"  
+|-  
+! Argument  
+! Description  
+! Default value  
+|-  
+| **s**  
+| The pagename, which will passed to the plugin.  
+| //empty//  
+|-  
+| **initial_content**  
+| The new page will be pre-filled with this content.  
+| //empty//  
+|-  
+| **template**  
+| The new page will be pre-filled with the content of this page.  
+| //empty//  
+|-  
+| **vars**  
+| Variables to be expanded.  
+|  
+|-  
+| **overwrite**  
+| Boolean. If true, overwrite an existing page.  
+| false  
+|}  
  
-!! Variable Expansion 
+== Variable Expansion ==  
  
 The content (either initial_content or template) might hold some variables, which will be 
 expanded on creation. Unassigned variables will stay as %%<var>%%, assigned variables without 
 matching %%<var>%% placeholder will be ignored, without any warning. 
  
-A variable in a template is denoted as <tt> %%var%%</tt> , which will be expanded by the  
-value of <tt> var</tt> given to the vars argument (in urlencoded php notation). 
+A variable in a template is denoted as ## %%var%%## , which will be expanded by the  
+value of ## var## given to the vars argument (in urlencoded php notation). 
  
 Some special variables are automatically assigned: 
+{| class="bordered"  
+|-  
+| %%ctime%% || $~WikiTheme->formatDateTime(time())  
+|-  
+| %%author%% || $user->getId()  
+|}  
  
-%%ctime%% |  
- $WikiTheme->formatDateTime(time())  
-%%author%% |  
- $user->getId()  
+This forms together with page templates and the [[Help:WikiFormRichPlugin]] and  
+optionally the [[Help:SqlResultPlugin]] a framework to create templated pages.  
  
-This forms together with page templates and the PhpWiki:WikiFormRichPlugin and  
-optionally the PhpWiki :SqlResultPlugin a framework to create templated pages.  
+== Authors ==  
+* Dan Frankowski  
+* [[Help :Reini Urban|Reini Urban]]  
  
-!! Authors  
-  
-Dan Frankowski, Reini Urban  
-  
-!! Examples 
+== Examples ==  
  
+{{{  
+<?plugin-form CreatePage s=MyHomePage ?>  
+}}}  
 <?plugin-form CreatePage s=MyHomePage ?> 
  
-See also PhpWiki:EasilyCreateNewPages, PhpWiki :WikiFormRichPlugin, PhpWiki :SqlResultPlugin  
-  
--------------  
+== See Also ==  
+* [[Help :WikiFormRichPlugin]]  
+* [[Help :SqlResultPlugin]]  
  
-PhpWikiDocumentation Help:WikiPlugin  
+<noinclude>  
+----  
+[[ PhpWikiDocumentation]] [[CategoryWikiPlugin]]  
+</noinclude>  

current version

The CreatePage plugin allows to easily create new pages, optionally with default content.

This allows you to create a page getting the new pagename from a forms-based interface, and optionally with the initial content from some template.

Put a <?plugin-form CreatePage ?> at some page, browse this page, enter the name of the page to create, then click the button.

Usage

<?plugin-form CreatePage ?>
<?plugin-form CreatePage template=CategoryHomePage ?>
<?plugin-form CreatePage template=SomeTemplatePage vars="year=2004&name=None" ?>

Arguments

Argument

Description

Default value

s

The pagename, which will passed to the plugin.

empty

initial_content

The new page will be pre-filled with this content.

empty

template

The new page will be pre-filled with the content of this page.

empty

vars

Variables to be expanded.

overwrite

Boolean. If true, overwrite an existing page.

false

Variable Expansion

The content (either initial_content or template) might hold some variables, which will be expanded on creation. Unassigned variables will stay as %%<var>%%, assigned variables without matching %%<var>%% placeholder will be ignored, without any warning.

A variable in a template is denoted as %%var%%, which will be expanded by the value of var given to the vars argument (in urlencoded php notation).

Some special variables are automatically assigned:

%%ctime%%

$WikiTheme->formatDateTime(time())

%%author%%

$user->getId()

This forms together with page templates and the Help:WikiFormRichPlugin and optionally the Help:SqlResultPlugin a framework to create templated pages.

Authors

Examples

<?plugin-form CreatePage s=MyHomePage ?>

See Also