biggates的心得

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

XML 中的 <ModulePrefs> 标签里的属性指定了这个 Gadget 的属性,比如标题、作者、联系方式,等等。我们来看下面的例子:

 1<Module>
 2  <ModulePrefs title="测试用 Gadget "
 3    title_url="http://biggates.cnblogs.com/"
 4    height="200"
 5    author="biggates"
 6    author_email="abc@def.com"/>
 7  <Content >
 8     这里是内容 
 9  </Content>
10</Module>

这些属性是无法被用户所更改的。
下面列出了这些属性的值:
 

Attribute Description
title Optional string that provides the title of the gadget. This title is displayed in the gadget title bar on iGoogle. If this string contains user preference substitution variables and you are planning to submit your gadget to the content directory, you should also provide a directory_title for directory display.
directory_title Optional string that provides the title that should be displayed for your gadget in the content directory. Should contain only the literal text to be displayed, not user preference substitution variables. This is because the content directory displays a static view of your gadget, and therefore can't perform the necessary substitution to produce a reasonable title. For example, if your gadget's title is "Friends for __UP_name__", the directory is not able to perform the substitution to provide a reasonable value for " __UP_name__". So you might set your directory_title to be simply "Friends".
title_url Optional string that provides a URL that the gadget title links to. For example, you could link the title to a webpage related to the gadget.
description Optional string that describes the gadget.
author Optional string that lists the author of the gadget.
author_email Optional string that provides the gadget author's email address. You can use any email system, but you should not use a personal email address because of spam. One approach is to use an email address of the form helensmith.feedback+coolgadget@gmail.com in your gadget spec.

Gmail drops everything after the plus sign (+), so this email address is interpreted as helensmith.feedback@gmail.com.

You can create a Gmail account here.
author_affiliation Optional string such as "Google" that indicates the author's affiliation. This attribute is required for gadgets that are included in the content directory.
author_location The author's geographical location, such as "Mountain View , CA, USA ".
screenshot Optional string that gives the URL of a gadget screenshot. This must be an image on a public web site that is not blocked by robots.txt. PNG is the preferred format, though GIF and JPG are also acceptable. Gadget screenshots should be 280 pixels wide. The height of the screenshot should be the "natural" height of the gadget when it's in use. For more discussion of screenshot guidelines, see Publishing to the Content Directory.
thumbnail Optional string that gives the URL of a gadget thumbnail. This must be an image on a public web site that is not blocked by robots.txt. PNG is the preferred format, though GIF and JPG are also acceptable. Gadget thumbnails should be 120x60 pixels. For more discussion of thumbnail guidelines, see Publishing to the Content Directory.
height Optional positive integer that specifies the height of the area in which the gadget runs. The default height is 200.
width Optional positive integer that specifies the width of the area in which the gadget runs. This setting only applies to syndicated gadgets. The default width is 320.
scaling Optional boolean that specifies whether the aspect ratio (height-to-width ratio) of the gadget is maintained when the browser is resized. Gadgets that can automatically scale vertically should set this to true, but gadgets which have a fixed height should set this to false. The default is true.
scrolling Optional boolean that provides vertical and/or horizontal scrollbars if the content exceeds the space provided. If false, then the content is clipped to the height and width provided (not that width is not configurable). The default is false.
singleton Optional boolean that specifies whether users can add a gadget multiple times from a directory. The default is true, meaning that by default, gadgets can only be added once. Directories can handle this attribute however they choose. For example, the content directory handles singleton="true" by graying out and displaying the text "Added" for gadgets that have already been added. Note that changes to this attribute may not be picked up by directories right away.

This attribute doesn't prevent users from adding gadgets multiple times through the developer gadget or Add by URL. Consequently, you still need to write your gadget to support multiple instances.
author_photo For the authors page, a URL to a photo (70x100 PNG format preferred, but JPG/GIF are also supported).
author_aboutme For the authors page, a statement about yourself (try to keep to ~500 characters).
author_link For the authors page, a link to your website, blog, etc.
author_quote For the authors page, a quote you'd like to include (try to keep to ~300 characters).

posted on 2008-01-08 13:55  biggates  阅读(643)  评论(0编辑  收藏  举报