Was this page helpful?

Wiki.GetPage

    Table of contents
    1. 1. Usage Restrictions
    2. 2. Parameters
    3. 3. Result
    4. 4. Samples
    wiki.GetPage(page : any) : map

    Get page object at wiki page path.

    Usage Restrictions

    8.05.1 or later.

    Parameters

    Name Type Description
    page
    any wiki page path or id; if argument is of type str, then it is treated as a path; if argument is of type num then it's treated as an id

    Result

    Returns the page object if the page exists, otherwise nil.

    Samples

      Output

    Get page object using the current page's path:

    {{ wiki.getpage(page.path) }} 
    { api : "http://developer.mindtouch.com/@api/deki/pages/21232", author : "local://17a8dfc237954830a4cab1fd4f9dd575/deki/$user", comments : "local://17a8dfc237954830a4cab1fd4f9dd575/deki/$pagecomments", contents : "local://17a8dfc237954830a4cab1fd4f9dd575/deki/$pagecontents", date : "Mon, 28 Jul 2008 00:42:13 GMT", editsummary : "20 words added, 2 words removed", feed : "http://developer.mindtouch.com/@api/deki/pages/21232/feed", files : "local://17a8dfc237954830a4cab1fd4f9dd575/deki/$files", fronturi : "http://developer.mindtouch.com/en/docs/DekiScript/Reference/Wiki_Functions_and_Variables/Wiki.GetPage", id : 21232, ishidden : False, language : nil, mime : "application/x.deki0805+xml", name : "Wiki.GetPage", namespace : "", parent : "local://17a8dfc237954830a4cab1fd4f9dd575/deki/$page", parents : "local://17a8dfc237954830a4cab1fd4f9dd575/deki/$parents", path : "en/docs/DekiScript/Reference/Wiki_Functions_and_Variables/Wiki.GetPage", properties : "local://17a8dfc237954830a4cab1fd4f9dd575/deki/$pageprops", rating : "local://17a8dfc237954830a4cab1fd4f9dd575/deki/$rating", redirect : nil, revision : 3, revisions : "local://17a8dfc237954830a4cab1fd4f9dd575/deki/$revisions", subpages : "local://17a8dfc237954830a4cab1fd4f9dd575/deki/$subpages", tags : "local://17a8dfc237954830a4cab1fd4f9dd575/deki/$pagetags", talkuri : "http://developer.mindtouch.com/Talk:en/docs/DekiScript/Reference/Wiki_Functions_and_Variables/Wiki.GetPage", text : "local://17a8dfc237954830a4cab1fd4f9dd575/deki/$pagetext", title : "Wiki.GetPage", toc : <html><body><span id="page.toc">nil</span></body></html>, unprefixedpath : "en/docs/DekiScript/Reference/Wiki_Functions_and_Variables/Wiki.GetPage", uri : "http://developer.mindtouch.com/en/docs/DekiScript/Reference/Wiki_Functions_and_Variables/Wiki.GetPage", viewcount : "local://17a8dfc237954830a4cab1fd4f9dd575/deki/$pageviewcount", xml : "local://17a8dfc237954830a4cab1fd4f9dd575/deki/$pagexml" }

    Get page object using the current page's id:

    {{ wiki.getpage(page.id) }} 

    { api : "http://developer.mindtouch.com/@api/deki/pages/21232", author : "local://17a8dfc237954830a4cab1fd4f9dd575/deki/$user", comments : "local://17a8dfc237954830a4cab1fd4f9dd575/deki/$pagecomments", contents : "local://17a8dfc237954830a4cab1fd4f9dd575/deki/$pagecontents", date : "Mon, 28 Jul 2008 00:42:13 GMT", editsummary : "20 words added, 2 words removed", feed : "http://developer.mindtouch.com/@api/deki/pages/21232/feed", files : "local://17a8dfc237954830a4cab1fd4f9dd575/deki/$files", fronturi : "http://developer.mindtouch.com/en/docs/DekiScript/Reference/Wiki_Functions_and_Variables/Wiki.GetPage", id : 21232, ishidden : False, language : nil, mime : "application/x.deki0805+xml", name : "Wiki.GetPage", namespace : "", parent : "local://17a8dfc237954830a4cab1fd4f9dd575/deki/$page", parents : "local://17a8dfc237954830a4cab1fd4f9dd575/deki/$parents", path : "en/docs/DekiScript/Reference/Wiki_Functions_and_Variables/Wiki.GetPage", properties : "local://17a8dfc237954830a4cab1fd4f9dd575/deki/$pageprops", rating : "local://17a8dfc237954830a4cab1fd4f9dd575/deki/$rating", redirect : nil, revision : 3, revisions : "local://17a8dfc237954830a4cab1fd4f9dd575/deki/$revisions", subpages : "local://17a8dfc237954830a4cab1fd4f9dd575/deki/$subpages", tags : "local://17a8dfc237954830a4cab1fd4f9dd575/deki/$pagetags", talkuri : "http://developer.mindtouch.com/Talk:en/docs/DekiScript/Reference/Wiki_Functions_and_Variables/Wiki.GetPage", text : "local://17a8dfc237954830a4cab1fd4f9dd575/deki/$pagetext", title : "Wiki.GetPage", toc : <html><body><span id="page.toc">nil</span></body></html>, unprefixedpath : "en/docs/DekiScript/Reference/Wiki_Functions_and_Variables/Wiki.GetPage", uri : "http://developer.mindtouch.com/en/docs/DekiScript/Reference/Wiki_Functions_and_Variables/Wiki.GetPage", viewcount : "local://17a8dfc237954830a4cab1fd4f9dd575/deki/$pageviewcount", xml : "local://17a8dfc237954830a4cab1fd4f9dd575/deki/$pagexml" }


     

    Was this page helpful?
    Tag page
    Viewing 2 of 2 comments: view all
    test comment to see if it is mapad
    Posted 01:05, 24 Jun 2009
    As per a comment by SteveB at http://forums.developer.mindtouch.com/showthread.php?7296-wiki.getpage-Functionality, it looks like his function actually returns an empty map, not nil, if a page isn't found. Check for the existence of page.id. If !page.id then the page doesn't exist.
    Posted 20:49, 3 Aug 2011
    Viewing 2 of 2 comments: view all
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by