Was this page helpful?

Wiki.Create

    Table of contents
    1. 1. Usage Restrictions
    2. 2. Parameters
    3. 3. Result
    4. 4. Samples
    wiki.Create(label : str?, path : str?, template : str?, button : bool?, title : str?) : xml
    

    Insert a link or button to create a new page.

    Usage Restrictions

    1.9.1 or later; 8.05.1 or later args parameter added

    Parameters

    Name Type Description
    label str (optional, default:"New Page") label for edit link or button
    path str (optional, default: current page) path to parent page for new page
    template str (optional, default: system default) template to use to populate new page
    button bool (optional, default: true) show as button
    title str (optional, default: "Page Title") title of page; a number will be placed next to title if it already exists in path (e.g. "Page Title 2")
    args
    map
    (optional, default: nil) request arguments to pass to new page (8.05.1 or later)

     

    Result

    creates a link to a new page

    Samples

      Output

    to create a new page:

    {{ wiki.create() }} 

     

    The following demonstrates how to pass arguments to a template page.

    First, it is necessary to create a template page with the arguments wished to be rendered.

    For this example, this template page is used.

    The path: user.homepage.path instructs the function to create a page at your user page.

    Second, the function below is edited into a regular page:

    {{ wiki.create{path: user.homepage.path, template:"Test Wiki.Create", 
    args:{first:"Hello World", second:2}} }} 

     

     

    Was this page helpful?
    Tag page
    Viewing 6 of 6 comments: view all
    Changed parameter table when I saw this page:
    http://wiki.opengarden.org/MindTouch_Deki/FAQ/Page_Management/How_do_I...Create_automated_pages%3f edited 03:44, 11 Jun 2008
    Posted 03:44, 11 Jun 2008
    Could someone expound a little on
    args map (optional, default: nil) request arguments to pass to new page (8.05.1 or later)

    This looks intriguing but I'm not really sure what I can send to it.
    Posted 05:53, 22 Apr 2009
    @melder Any idea why this fails? (10.0.7 Core installation)
    {{ wiki.create( label: "Create Progress Report", template: "PMS/Project_Home_Page", title: page.title" - Progress Report" ) }}
    Posted 15:53, 19 Apr 2011
    @travellingwithoutmoving missing operator. try: page.title .. " - Progress Report"
    Posted 18:55, 19 Apr 2011
    @SteveB - I've tried that, and it's still failing:
    {{ wiki.create( label: "Create Progress Report", template: "PMS/Project_Home_Page", title: page.title .. " - Progress Report" ) }}
    Gives error:
    ")" expected: p[2]/span, line 1, column 19 (click for details)

    Callstack:
    at Template:PMS/Project_Home_Page

    MindTouch.Deki.Script.Compiler.DekiScriptParserException: ")" expected: p[2]/span, line 1, column 19
    at MindTouch.Deki.Script.Compiler.Errors.SynErr (System.String origin, Int32 line, Int32 col, Int32 n) [0x00000]
    at MindTouch.Deki.Script.Compiler.Parser.SynErr (Int32 n) [0x00000]
    at MindTouch.Deki.Script.Compiler.Parser.Expect (Int32 n) [0x00000]
    at MindTouch.Deki.Script.Compiler.Parser.ArgList (MindTouch.Deki.Script.Expr.Location& location, MindTouch.Deki.Script.Expr.DekiScriptExpression& expr) [0x00000]
    at MindTouch.Deki.Script.Compiler.Parser.Primary (MindTouch.Deki.Script.Expr.DekiScriptExpression& expr) [0x00000]
    at MindTouch.Deki.Script.Compiler.Parser.Unary (MindTouch.Deki.Script.Expr.DekiScriptExpression& expr) [0x00000]
    at MindTouch.Deki.Script.Compiler.Parser.MulExpr (MindTouch.Deki.Script.Expr.DekiScriptExpression& expr) [0x00000]
    at MindTouch.Deki.Script.Compiler.Parser.AddExpr (MindTouch.Deki.Script.Expr.DekiScriptExpression& expr) [0x00000]
    at MindTouch.Deki.Script.Compiler.Parser.ConcatExpr (MindTouch.Deki.Script.Expr.DekiScriptExpression& expr) [0x00000]
    at MindTouch.Deki.Script.Compiler.Parser.RelExpr (MindTouch.Deki.Script.Expr.DekiScriptExpression& expr) [0x00000]
    at MindTouch.Deki.Script.Compiler.Parser.EqlExpr (MindTouch.Deki.Script.Expr.DekiScriptExpression& expr) [0x00000]
    at MindTouch.Deki.Script.Compiler.Parser.AndExpr (MindTouch.Deki.Script.Expr.DekiScriptExpression& expr) [0x00000]
    at MindTouch.Deki.Script.Compiler.Parser.OrExpr (MindTouch.Deki.Script.Expr.DekiScriptExpression& expr) [0x00000]
    at MindTouch.Deki.Script.Compiler.Parser.NullCoalescingExpr (MindTouch.Deki.Script.Expr.DekiScriptExpression& expr) [0x00000]
    at MindTouch.Deki.Script.Compiler.Parser.TernaryExpression (MindTouch.Deki.Script.Expr.DekiScriptExpression& expr) [0x00000]
    at MindTouch.Deki.Script.Compiler.Parser.Expression (MindTouch.Deki.Script.Expr.DekiScriptExpression& expr) [0x00000]
    at MindTouch.Deki.Script.Compiler.Parser.Statements (MindTouch.Deki.Script.Expr.DekiScriptExpression& expr) [0x00000]
    at MindTouch.Deki.Script.Compiler.Parser.DekiScript () [0x00000]
    at MindTouch.Deki.Script.Compiler.Parser.Parse () [0x00000]
    at MindTouch.Deki.Script.Compiler.DekiScriptParser.Parse (Location location, System.String source) [0x00000]
    at MindTouch.Deki.Script.DekiScriptInterpreter.Evaluate (MindTouch.Xml.XDoc script, System.Xml.XmlElement node, MindTouch.Deki.Script.DekiScriptEvalContext context, MindTouch.Deki.Script.Runtime.DekiScriptEnv env, MindTouch.Deki.Script.DekiScriptRuntime runtime, System.Boolean& scripted, System.Boolean& error) [0x00000]
    -----------------------
    Out of interest, how do I know which part of the expression 'column 19' is? It would help my troubleshooting..
    Posted 14:19, 20 Apr 2011
    How do I get wiki.Create() to copy the tags from the template, or even to apply tags specified as a parameter? The template's tags (either genuine tags or in edit: template:tag-insert code) are copied ok if I create pages using the 'New Page' button and select the template from the gallery, but they don't come across if I use wiki.Create(). Can I pass the tags I want in the arguments? How then do I get them to be applied to the resulting page? There should perhaps be a "Tags" parameter for wiki.Create() ?
    Posted 17:34, 13 Nov 2011
    Viewing 6 of 6 comments: view all
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by