SharePoint Chinese Wiki

论坛 | 成员 | 关于 | 搜索    


片段

修改时间: 2007-06-06 23:35 由 chiz - 编目为: Wiki帮助文档
Since version 2.0, ScrewTurn Wiki supports Snippets. This page will help you understand how to use them.


编辑

1 - What is a Snippet?

A Snippet is a typically small piece of text that can be included anywhere in the Wiki. A Snippet can contain WikiMarkup, XHTML and plain-text. Snippets can be created, deleted and modified only by the Administrators, using the dedicated panel in the administration page. Every Snippet must have a unique name.

编辑

2 - Using Snippets

A snippet can be inserted by simply using the following syntax:

{s:SnippetName}

where SnippetName is the name of the snippet you want to insert (case insensitive).

You can add a snippet in a Page or in any of the "meta" files (Sidebar, Header, etc.). Snippets are "resolved" recursively, so you can insert a Snippet into another. If you insert a non-existent Snippet, you will get a red warning in the Page stating "FORMATTER ERROR (Snippet Not Found)."

编辑

2.1 - Example

To produce a reusable Draft snippet like this:

FORMATTER ERROR (Snippet Not Found) you should paste the following code into a new Snippet named Draft in the administration interface (see next section):

<div style="border-top: solid 2px #FED626; border-bottom: solid 2px #FED626; padding: 4px 4px 4px 36px; vertical-align: middle; background-color: #FFF7C0; background-image: url({UP}Alert.png); background-repeat: no-repeat; background-position: 10px center;">
This page is a ''Draft'', its content is not complete and might contain errors.
</div>

You then should upload the Alert.png file into your Wiki using the File Management page.

编辑

2.2 - Toolbar

You can also insert a Snippet using the handy "Insert a Snippet" button of the editing Toolbar, which displays a menu containing all the available Snippets.

编辑

3 - Snippets Management

=
图片

Snippets Management

The Snippets tab of the administration interface allows you to create, edit and delete snippets. The list displays the existing Snippets and their Provider.

编辑

3.1 - Creating a new Snippet

To create a new Snippet, click on the New button and insert the Snippet name and content. You can also select the Provider to use for the new Snippet. When you are finished, click on the Save Snippet button.

编辑

3.2 - Deleting a Snippet

To delete a Snippet, select it in the list and then click on the Delete button. You will be asked to confirm the operation.

编辑

3.3 - Modifying a Snippet

You can edit the content of a Snippet (but not the Name). To do so, select it in the list and then click on the Edit button. Modify the content, and then click on the Save Snippet button.
Copyright ©2006-2007 SharePoint中文Wiki, All Rights reserved.京ICP备06059951号