[All Adaptavist Apps]

Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Wiki Markup
{excerpt}The Office Connector (also known as Word/DAV plugin) allows you to import from or edit pages in popular word processing applications such as MS Word and Open Office Writer. This tutorial shows how to add navigation links to these features.{excerpt}

h2. Overview

The "Edit in Word" feature allows you to edit a wiki page using popular word processing applications. When you click the link, the page will open in the word processor (you'll sometimes be asked to log-in while doing this) and when you've made your changes simply save the document and the wiki page will be updated (you'll have to refresh the wiki pages to see the changes take effect).

The "Doc Import" feature allows you to import a word processor document in to a wiki page. This is useful when you have documents that contain formatting that's not possible using wiki markup - the document will be rendered in your wiki page as close as is possible to the original, but not nessecarily exactly the same.

{note:title=Important}
The code snippets below have been split on to multiple lines to make them easier to read. When you are adding them to your theme layout please remember to put everything on a single line.

*You must have the plugin installed before you can use these features.* Also, please note that the links are different depending on your version of Confluence.
{note}

h2. Edit In Word macro

The Office Connector plugin has a handy macro that you can drop in to any theme panel to add an "Edit in Word" link:

{noformat}
{editinwordlink}
{noformat}

You can see some examples in the [Office Connector Support FAQ|http://confluence.atlassian.com/display/CONFEXT/Office+Connector+Support+FAQ].

h2. Confluence 2.8 and above

The way that the edit in word link is generated by the office connector code is not compatible with the builder menu system, to work around this we have duplicated and refined the office-connector's code and included it within builder (not the connector itself, but the code that calls it), to use the edit in word feature in a builder menu you will need Builder 3.3.0 or later and use the following syntax

{code}
{compound-menuitem:editInWord|icon=word|caption=Edit this %page% in word...}
{code}

(on) *Tip:* You can use any of the [menu icons|Builder 3.x Icons] available in Theme Builder if preferred.

To add the "Doc Import" link to your menu, use the following notation:

{code}
{compound-menuitem:webui
                  |location=system.content.action/secondary
                  |key=importworditem1
                  |caption=Doc Import}
{code}

h2. Confluence 2.7 and earlier

The way that the edit in word link is generated by the office connector code is not compatible with the builder menu system, to work around this we have duplicated and refined the office-connector's code and included it within builder (not the connector itself, but the code that calls it), to use the edit in word feature in a builder menu you will need Builder 3.3.0 or later and use the following syntax

{code}
{compound-menuitem:editInWord|icon=word|caption=Edit this %page% in word...}
{code}

(on) *Tip:* You can use any of the [menu icons|Builder 3.x Icons] available in Theme Builder if preferred.

To add the "Doc Import" link to your menu, use the following notation:

{code}
{compound-menuitem:webui
                  |location=system.page
                  |key=importworditem
                  |caption=Doc Import}
{code}

h2. Adding the links to the Edit menu

Go in to the [Layout Manager] and click on the [Menus Tab]:

!MenuShortcutMacros.png|align=center!

Click on the "Edit" button in the "Menu Shortcut Macros" section and then click on the "Edit Menu" tab of the window that appears:

!EditMenuAddTheWordDAVlinks.png|align=center!

Add the appropriate macros based on the version of Confluence you are using (see above) and then click the "OK" button to confirm the changes.

Save your layout (click the {menuicon:disk_blue} button - see [Layout Manager] for more details) and you should see the new links appear in the Edit menu.

h2. Adding text hyperlinks (outside of a menu)

To add text hyperlinks outside of a menu, eg. in a sidebar, just add the "flat=true" parameter to the [compound-menuitem macro], for example:

{code}
{compound-menuitem:webui
                  |location=system.content.action/primary
                  |key=editinworditem3
                  |icon=page_white_word
                  |caption=Edit in Word
                  |flat=true}
{code}