Adding snippets in the drop-down text

This forum is for all Flare related Tips and Tricks.
Have a tip or trick you use while working in Flare? Share it here.
Post Reply
nraniroja
Jr. Propeller Head
Posts: 3
Joined: Wed Aug 07, 2019 5:32 pm

Adding snippets in the drop-down text

Post by nraniroja »

Hi All,

I am looking to add snippets in the drop down text.

I have two drop down texts in the same topic and both of them have some similar steps, and to avoid rewriting the steps I want to use snippets (I shall be using the same steps in other topics too). Now the problem I am facing is, the snippets are in Number List and the order of this may change. For example, in drop-down text 1 my snippet which has an order of 2, 3, 4 may not be in the same order in drop down text 2 or for that matter in any topics where I may reuse the text. Can anyone please help me address this? Or am I choosing a wrong option - Snippet, and there is some other feature in Flare that can help me achieve this? Please help me either ways.

Thanks

Roja
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: Adding snippets in the drop-down text

Post by doc_guy »

I think the feature you need is actually snippet conditions. You can read about this in the help, but here is the overall workflow:

1. Create a new Condition Tag Set for Snippet Conditions, and create conditions for each version of the snippet you need.
2. Create the snippet. Use the conditions to mark the changes. (Hint: use the show/hide conditions in the XML editor to see only one condition at a time to make sure that each version is correct.)
Image
3. Use that snippet in each topic where you need the snippet to appear.
4. Right-click on the snippet, and choose "snippet conditions" and choose which snippet conditions to EXCLUDE in this topic. (No need to mark "Include" because unless you exclude it, the content will be included automatically.)
5. Repeat steps 3 and 4 in any other topics that use the snippet, setting the EXCLUDE accordingly.
6. Make sure that you never set any conditions in the snippet condition tag set in a target. These are only set at the topic level.
Paul Pehrson
My Blog

Image
JRtechw
Propeller Head
Posts: 68
Joined: Thu Oct 05, 2017 8:08 pm

Re: Adding snippets in the drop-down text

Post by JRtechw »

Hi Roja,

I tested this, and Flare will happily let you just put <li></li> elements by themselves in a snippet, without surrounding <ol> or <ul> elements. You can then insert the snippet anywhere in a list on a line by itself, and when Flare compiles the output the builder will just seamlesly stitch up the steps with the correct numbering.

So, your snippet HTML might look like this:

Code: Select all

<body>
        <li>This is step 1 in the snippet. </li>
        <li>This is step 2 in the snippet. </li>
        <li>This is step 3 in the snippet. </li>
        </body>
And your insertion HTML might look like this:

Code: Select all

<ol>
            <li>This is step 1 outside the snippet. </li>
            <MadCap:snippetBlock src="Snippets/runontest.flsnp" />
            <li>This is the first step after the snippet. </li>
         </ol>
Build it, and your steps will appear as 1 through 5.
Post Reply