1 of 1 found this page helpful

Page.Files

    Table of contents
    1. 1. Usage Restrictions
    2. 2. Result
    3. 3. Samples
    page.Files: map
    

    The files attached to the current page.

    Usage Restrictions

    1.9.1 or later

    Result

    A map of the current page's file to its file link.

    Samples

      Output

    to get a page's subpage' info:

    {{ page.files}} 

     

    { "metaCopyright.jpg" : "local://8be0fa3289404f99a6b6f218cc6cbaba/deki/$file", "metaRating.jpg" : "local://8be0fa3289404f99a6b6f218cc6cbaba/deki/$file" }

    retrieve properties of the first image by converting the map to a list
    The list contains a key and value argument for each map element, so to access the file properties you need to add "value"

    {{var myList = map.keyvalues(page.files);
    myList[0].value;
    }}
    
    { api : "http://developer.mindtouch.com/@api/deki/files/2393", author : "local://8be0fa3289404f99a6b6f218cc6cbaba/deki/$user", date : "Tue, 26 Oct 2010 07:57:25 GMT", description : "local://8be0fa3289404f99a6b6f218cc6cbaba/deki/$filedesc", editsummary : nil, id : 2393, imageframes : 1, imageheight : 100, imagewidth : 370, mime : "image/jpeg", name : "metaRating.jpg", page : "local://8be0fa3289404f99a6b6f218cc6cbaba/deki/$page", properties : "local://8be0fa3289404f99a6b6f218cc6cbaba/deki/$fileprops", size : 19422, thumburi : "http://developer.mindtouch.com/@api/deki/files/2393/=metaRating.jpg?size=thumb", uri : "http://developer.mindtouch.com/@api/deki/files/2393/=metaRating.jpg", webviewuri : "http://developer.mindtouch.com/@api/deki/files/2393/=metaRating.jpg?size=webview" }

    retrieve some properties of the first image

    {{var myList = map.keyvalues(page.files);
    myList[0].value.description;<br/>
    myList[0].value.date;<br/>
    myList[0].value.author.name;<br/>
    
    web.image(myList[0].value.uri);<br/>
    }}
    

     

    Rating
    Tue, 26 Oct 2010 07:57:25 GMT
    SteveB

     

    Was this page helpful?
    Tag page

    Files 2

    FileVersionSizeModified 
    Viewing 2 of 2 comments: view all
    I want to expand this script to display an image that matches a certain description
    Posted 16:11, 7 Aug 2009
    Is there a way to use Page.Files similar to Page.TOC where it just gives me a bulleted list?
    Posted 08:18, 8 Dec 2010
    Viewing 2 of 2 comments: view all
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by