When you are writing content in Flare, web you may decide that you want to re-use some content that you previously added to another topic.
We’ve discussed before how the best way to do this is to use a snippet, which essentially is a really long, formatted variable.
To do this in Flare, you create a new snippet, then you locate the text you want to re-use, and copy the text out of that topic and paste it into the snippet. Then you replace the text in the original topic with the snippet, then insert the snippet into the new location.
This isn’t too hard, but I’ve long wanted to use a nifty shortcut, but couldn’t figure out how to make it work. See, when you are writing in the XML editor, there is an option on the context menu (right-click) menu that allows you to create a snippet from an existing block. That works great if all you want to add to the snippet is a single paragraph, but it doesn’t work if you want to add multiple block-level elements into the snippet.
Today I thought of a way to do this quickly and easily, even with multiple blocks.
Here is what you do.
- Open the topic that contains the text that you want to turn into a snippet.
- Select the blocks that you want to re-use.
- From the Format menu, select Group.
- From the pop-up, select the div option. (This groups the selected content into a single block, the DIV block.)
- Now, right click on the DIV block, and select “Create Snippet”.
- Give the snippet a name and click the Create button. The snippet is created and inserted into the original topic
- Go to your new topic and insert the snippet into it.
If you are creating Word or Framemaker output, you may need to change one additional thing:
- Right click on the snippet block, and select “Open Link”. The snippet file itself opens.
- Right click on the div block, and from the Edit menu, select “Unbind”.
This removes the div, which can cause positioning problems in Word and Framemaker outputs. (I don’t actually know if you NEED to do this extra step, but it isn’t a bad idea.)
Using a div to create a snippet is much faster, in my opinion, when you are trying to create a snippet from a multi-block selection. Try it, and I think you’ll agree.
(This article has been cross-posted on DocGuy Training.)