Was this page helpful?

Web.Style

    Table of contents
    1. 1. Usage Restrictions
    2. 2. Parameters
    3. 3. Result
    4. 4. Samples
    web.Style(name : str, value : str) : str

    Create text for a 'style' attribute.

    Usage Restrictions

    1.8.3 or later.

    Parameters

    Name Type Description
    name
    str
    The style name.
    value
    str
    The style value.

    Result

    The style text.

    Samples


    Output

    To create width style text:

    {{ web.style('width', web.size(5)) }}

    width:5px;

    Sample DekiScript extension to render an image using a style width and height specified by the user.  Note that web.style and web.size are used to format the output:

    <extension>
      <function>
        <name>image</name> 
        <description>Simple DekiScript Sample to render an image.</description> 
        <param name="width" type="int">width</param> 
        <param name="height" type="int">height</param> 
        <return>
          <html xmlns:eval="http://mindtouch.com/2007/dekiscript">
            <body>
             <img src="http://wiki.opengarden.org/@api/deki/site/logo.png" eval:style="web.style('width', web.size(args.width)) .. web.style('height', web.size(args.height))"/>
            </body>
          </html>
        </return>
      </function>
    </extension>

    N/A

    Was this page helpful?
    Tag page
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by