{add-page-form}
Plugin: Linking Plugin, from version 2.5.0
Creates a simple form on a page for users to enter the name of the new page to add.
Description
Very similar to the add-page macro, this will then create a new page, which may be based on a template if so desired.
Usage
Parameters
| Name |
Required |
Default |
Description |
| template | | | The name of the Template to use when creating the page. |
| live | | false | If set to 'true', the template will be 'live' - that it it uses the live-template macro to import and execute the current value of the template every time the page is viewed. Requires the Scaffolding Plugin to be installed. |
| parent | | @self | The page you would like to be the parent of the new page. If no parent page is desired, set parent to a blank value. ie. 'parent='. There are also three special values:
- @self - sets the parent to the new page the macro appears in.
- @parent - sets the parent of the new page to the parent of the current page.
- @home - sets the parent of the new page to the home page of the current space.
|
| labels | | | The list of labels to attach to the new page. Only works for live template pages. |
| allowRename | | | (Since 2.4) If set to true, the user will be allowed to rename the page when it is being created. |
| nameWidth | | | If set, this specifies the width of the name text field. Can be any valid CSS width value, such as '300px' or '60%'. |
| class | | | (Since 2.6.5) Sets a class for the displayed form items. |
Examples
Create a new page based on a live template
See Also
When I use the add-page-form macro a comma gets added to the title of the current page when editing.
Thoughts?
{add-page-form:parent=people:Diligence|template=Contact|live=true|labels=%label%}Add Contact{add-page-form}Interesting it works just fine if I change the macro to add-page.
The problem will be due to having an extra input field called 'title', which is used by both the standard edit page and the field for add-page-form. The solution will be to disable the text field when editing a page. I've created a bug report here - watch it for updates on when this is fixed.
Works fine here with the hide-if- Macro from the Visibility Plugin
{hide-if:action=edit} {add-page-form:template=Live-Serverpage} Add Server {add-page-form} {hide-if}Yeah, that's not a bad workaround until the fix is released. I've implemented the solution but haven't had time to release it yet.
Is it in the works (and how soon?) to be able to pre-set the title of the page to add, similar to the functionality of the link-page macro? By using the %id% supplier, one can create several pages of the same name, save for the unique ID injected upon each creation.
Would it be possible to check for the existence of the entered page name BEFORE displaying the edit page? I'm using a live-template with scaffolding and this macro, and if the page name entered already exists, the user gets the standard edit page with the template code in it. Since the scaffolding form is not there, and the user just sees this:
{live-template:Report Page Input Template}they really don't know what to do. Go back? Just enter a new page name? It's very confusing.
The ideal solution would be to alert the user on the page where the add-page-form resides. An alternative solution would be to disable the edit field on the edit page, and show a message suggesting they go back and enter a new name. Any simple workarounds for this?