模板:WebSlice-begin/doc
此页面是Template:WebSlice-begin的模板文档。 此页面可能包含了模板的使用说明、分类和其他内容。 |
The {{WebSlice-begin}} and {{WebSlice-end}} templates can be used to create Web Slices out of certain content in a page. Web Slices are snippets of HTML content - marked up using hAtom
and hSlice
microformats - that the browser keeps updated. The snippet can be viewed in the browser without navigating to the article - with all formatting applied. Web Slices currently work in Internet Explorer 8 and Mozilla Firefox (the latter needs the WebChunks extension).
Usage
编辑To mark up a snippet as a Web Slice, add {{WebSlice-begin|id = n | title = WebSlice Title | expires = date/time}}
before the section and {{WebSlice-end}}
after the section. In the id
field, specify a sequence number for the Web Slice. For example, add 1 for the first Web Slice, 2 for the second and so on. If it is not specified, it defaults to 1. In the title
field, specify a human-readable title for the Web Slice. If it is not specified, the title of the page is used. The expires
parameter is optional; it is used to specify when the syndicated content becomes no longer valid and informs the browser to stop updating the Web Slice. For example if you are monitoring the RfA tally, you can set the Web Slice to expire around the estimated closing time of the RfA.
- Note - The expires parameter hasn't been implemented yet. Anyone willing to add support for it may look up the specification.
Browser Support
编辑This feature currently only works on Internet Explorer 8 and Firefox with the webchunks addon.
Parameters
编辑Required Parameters
编辑The following parameters are required: [1]
- id- The id must be a unique string (or integer) for that page. If you two web slices have the same id, then only the first one on that page will be recognized. Likewise, if the id changes, web browsers will be unable to update from the web slice.[1]
- title- The value of this will appear as the button text and will also appear in the "feeds discovery" button of IE. The title is limited to 128 characters.[1]
Optional Parameters
编辑The following parameters are optional.
- ttl- The "time to live" value is the minimum time in minutes to update. How often to update in minutes. The minimum value is 15, anything smaller will be set to 15. (It doesn't always seem to follow the time you set...if below 120.) [1][2]
- endtime- The date and time that the web slice expires. Given in the ISO 8601 format or the RFC822 date format (with 4-digit years) Valid examples are: [1][3][4]
Valid time formats: Mon, 15 Aug 05 15:52:01 +0000 22 Jul 2010 17:30:00 PDT Wed, 02 Oct 2002 08:00:00 EST Wed, 02 Oct 2002 13:00:00 GMT Wed, 02 Oct 2002 15:00:00 +0200
The Alternative Display Source, Alternative Navigation property and Alternative Update Source are net yet supported for security reasons.