Customizing the Ribbon
The Blog Account ribbon tab in Windows Live Writer offers functionality that is related to the user’s currently selected blog. The Shortcuts gallery on this tab contains buttons specific to the current blog provider. By default, this gallery contains a View Blog button. When clicked, this button opens a web browser at the blog homepage.
The <weblog> and <buttons> elements in the Writer manifest enable providers to customize the behavior and appearance of the ribbon in the following ways:
-
Specify the icon that is used on the Home tab.
-
Override the button text that is used for the View Blog and Manage Blog commands.
-
Provide the URL of the blog’s administrative interface at which to open the user’s web browser (Manage Blog command).
-
Provide custom buttons that open the user’s web browser (for example, at the friend page) and notify the user of changes and new content.
The remainder of this topic describes the use of the <weblog> element. The use of the <buttons> element is described in Defining Custom Buttons.
The following table enumerates the value subelements for the <weblog> element. All elements are optional. The default behavior of the element, if it is not included in the <weblog> element, is described in the "Behavior" section later in this topic.
|
<serviceName> |
Display name for the blog service. This name may differ from the blog engine. For example, "MSDN Blogs" is the name of a service, while "Community Server" is the name of the blog engine. |
|
<imageUrl> |
URL for the 16x16 Portable Network Graphic (PNG) image that is used as the icon for the blog. |
|
<homepageLinkText> |
Link text that is used for the View Blog link (for example, "View your space"). |
|
<adminLinkText> |
Link text used for the Manage Blog link (for example, "Edit your space"). |
|
<adminUrl> |
URL for the blog's administration page. Normally requires the use of URL macros such as {blog-homepage-url}. |
|
<postEditingUrl> |
URL used to edit posts online. Employs {post-id} macro to customize the URL dynamically for a specific post. |
The following <weblog> element makes use of all available subelements to customize the ribbon for Windows Live Spaces:
<weblog>
<serviceName>Windows Live Spaces</serviceName>
<imageUrl>images/SpacesIcon.png</imageUrl>
<homepageLinkText>View your space</homepageLinkText>
<adminLinkText>Edit your space</adminLinkText>
<adminUrl><![CDATA[
{blog-homepage-url}?_c02_owner=1
]]></adminUrl>
<postEditingUrl><![CDATA[
{blog-homepage-url}?_c11_BlogPart_handle=cns!{post-
id}&_c11_BlogPart_blogpart=blogentry&_c=BlogPart&_c02_owner=1
]]></postEditingUrl>
</weblog>
The following is the expected behavior in the Windows Live Writer user interface (UI) for each of the <weblog> elements (including default behavior when an element is not specified).
serviceName
The <serviceName> element is not currently used in the Writer UI. However, depending upon how the UI evolves, it may be used in the future and so we will continue to support it in the underlying format.
imageUrl
The <imageUrl> element determines the 16x16 PNG image that is displayed to the left of the blog name. Writer uses the following logic to determine the icon to display:
-
Check to see if there is an imageUrl value from the manifest file. If there is one, use it.
-
Check to see if a favicon.ico file is provided for the blog home page. If there is one, use it. (Note that favicon.ico is detected and downloaded only during a full blog configuration, not as part of automatic update processing).
-
If the preceding methods for finding the blog image fail, display the Writer application icon.
homepageLinkText and adminLinkText
The <homepageLinkText> and <adminLinkText> elements determine the caption for the links that direct users to their blog homepage and blog administration page, respectively. If these elements are not provided, the default text is used.
Note that the <adminLinkText> element is relevant only when an <adminUrl> element has been provided.
adminUrl
When present, the <adminUrl> element enables Writer to provide the Manage Blog link that is displayed immediately below the View Blog link. Normally, this URL makes use of macros (described previously) to get the right format for the current blog. For example, the value for Spaces includes the {blog-homepage-url} macro:
<adminUrl><![CDATA[
{blog-homepage-url}?_c02_owner=1
]]></adminUrl>
If a value for <adminUrl> is not present, Writer does not include the Manage Blog link.
postEditingUrl
When present, the <postEditingUrl> element causes Writer to enable the Post Draft and Edit Online command. For a description of how this command behaves, see the "Commands" section later in this topic.
This element normally makes use of two URL macros: one to customize the URL for the current blog, and one for the current post. For example, is the following code shows the <postEditingUrl> element for WordPress.com.
<postEditingUrl><![CDATA[
{blog-homepage-url}wp-admin/post.php?action=edit&post={post-id}
]]></postEditingUrl>
One additional command can be customized.
Post Draft and Edit Online
This command is enabled whenever a <postEditingUrl> element is provided. It appears on the application menu of the ribbon.
Writer executes the following sequence of actions when this command is invoked:
-
Posts a draft of the current post to the active blog. This is the same behavior as executing the Post Draft to Blog command.
-
Directs the user to the online editing page for the post. The user's browser is started by using the system-standard behavior for shell execution of a URL.
-
Resets the current editing window to a new post. This action makes it clear to the user that the editing context has shifted to the online UI.