How to create a list item snippet with variable numbering

This forum is for all Flare related Tips and Tricks.
Have a tip or trick you use while working in Flare? Share it here.

How to create a list item snippet with variable numbering

Postby bbuchko on Wed Jul 02, 2008 3:19 pm

Hey folks, I have a step that appears in several different procedures in my help file. The problem is, it's not always the same step #. I've successfully edited the snippet code to make it appear at the beginning of a list in a topic (step #1), but that's it. It contains formatting, so I cannot create a variable, unfortunately.

Any thoughts?
Bob Buchko
Technical Communicator
Corporate Trainer
Flare Noob
User avatar
bbuchko
Propeller Head
 
Posts: 59
Joined: Wed Jul 02, 2008 1:32 pm
Location: Raleigh, NC

Re: How to create a list item snippet with variable numbering

Postby Dave Lee on Thu Jul 03, 2008 2:43 am

First off, the snippet itself should not contain any list formatting, so remove that if it does.

To put the snippet in the list, try this:
1. Create your list.
2. On the line in your list where you want the snippet, right-click the li tag and select Make paragraph item(s).
3. Select Insert > Snippet.

Hopefully that should do the trick.

(If you didn't do step 2, you'd lose the li tag and therefore the list number too.)
Dave Lee
Master Propellus Maximus
 
Posts: 5822
Joined: Mon Mar 05, 2007 8:33 am
Location: UK

Re: How to create a list item snippet with variable numbering

Postby KevinDAmery on Thu Jul 03, 2008 5:11 am

There's another option as well. Snippets can be inserted two ways: as blocks, or inline. If you insert them inline, they take on whatever formatting exists for the block they are part of.

So an option would be to create a list item, add some dummy text to it (a letter or two is plenty) then insert the snippet AFTER the dummy text. This will make the snippet part of the li block. Then delete the dummy text, and you're done.
Until next time....
Image
Kevin Amery
Certified MAD for Flare
KevinDAmery
Propellus Maximus
 
Posts: 1985
Joined: Tue Jan 23, 2007 8:18 am
Location: Darn, I knew I was around here somewhere...

Re: How to create a list item snippet with variable numbering

Postby bbuchko on Thu Jul 03, 2008 6:33 am

Works like a charm. Thanks!!
Bob Buchko
Technical Communicator
Corporate Trainer
Flare Noob
User avatar
bbuchko
Propeller Head
 
Posts: 59
Joined: Wed Jul 02, 2008 1:32 pm
Location: Raleigh, NC

Re: How to create a list item snippet with variable numbering

Postby mkitegeo on Fri Aug 08, 2008 1:56 pm

Cool trick! This will work great for repetitive steps across similar but slightly different procedures (e.g. "Click the Next button.").

One word of caution, though.

When I tried this, I selected the text of a list item in an existing list and it created the entire list as the snippet instead of just taking the text I selected. It seems to work OK if the text for the snippet is NOT part of a list.
mkitegeo
Propeller Head
 
Posts: 11
Joined: Tue Jan 30, 2007 12:21 pm
Location: West Des Moines, Iowa, USA

Re: How to create a list item snippet with variable numbering

Postby KevinDAmery on Mon Aug 11, 2008 5:43 am

mkitegeo wrote:Cool trick! This will work great for repetitive steps across similar but slightly different procedures (e.g. "Click the Next button.").

One word of caution, though.

When I tried this, I selected the text of a list item in an existing list and it created the entire list as the snippet instead of just taking the text I selected. It seems to work OK if the text for the snippet is NOT part of a list.


Yes, this is a good point. It works best if the snippet is a p block (or even just text between opening and closing Body tags). The ramification of this is it requires each list item to be its own snippet - which can be a pain.
Until next time....
Image
Kevin Amery
Certified MAD for Flare
KevinDAmery
Propellus Maximus
 
Posts: 1985
Joined: Tue Jan 23, 2007 8:18 am
Location: Darn, I knew I was around here somewhere...

Re: How to create a list item snippet with variable numbering

Postby forfear on Wed Sep 17, 2008 8:58 am

Is there ascreenshot with topic and span blocks to show how all the list and snippets would look stacked up?

i am not sure if i am doing the right thing. I still can't insert a snippet with continuous numbering in an existing list.
If you submit your bug feedback request here, the more likely it'll get fixed or included in a future release
Open Utilities PageLayout Resizer for Flare/Blaze | Batch builder
forfear
Propellus Maximus
 
Posts: 766
Joined: Sat Feb 16, 2008 3:37 am
Location: Jungle Jingles

Re: How to create a list item snippet with variable numbering

Postby KevinDAmery on Wed Sep 17, 2008 9:15 am

The code would look a little like this:

Code: Select all
<ol>
<li>Here's some text</li>
<li><MadCap:snippetText src="Resources/Snippets/Contained.flsnp" /></li>
<li>Here's some more text</li>
</ol>
Until next time....
Image
Kevin Amery
Certified MAD for Flare
KevinDAmery
Propellus Maximus
 
Posts: 1985
Joined: Tue Jan 23, 2007 8:18 am
Location: Darn, I knew I was around here somewhere...

Re: How to create a list item snippet with variable numbering

Postby forfear on Thu Sep 18, 2008 7:38 am

Now I understand. Thanks Kevin!
I was thinking more along the lines of

1 Step
2 Step
3 Step
4 Step
5 Step
6 Step
7 Step

Where step 3 to step 6 came from one block of a snippet and the list autonumebered it from 3 to 6. So it looks like the snippet is for line by line of a step not a chunk of steps then. Thanks anyway.
If you submit your bug feedback request here, the more likely it'll get fixed or included in a future release
Open Utilities PageLayout Resizer for Flare/Blaze | Batch builder
forfear
Propellus Maximus
 
Posts: 766
Joined: Sat Feb 16, 2008 3:37 am
Location: Jungle Jingles

Re: How to create a list item snippet with variable numbering

Postby tbean on Thu Sep 18, 2008 9:34 am

Hi all --
Check out this thread:
viewtopic.php?f=13&t=5128&p=26698&hilit=snippet+%3Cbody%3E#p26698

It has a very clear explanation (including code samples) from doc_guy about what happens in the code when you create a and then insert a snippet and tells you, in nice numbered steps, how to achieve the desired results.

I follow doc_guy's suggestion when I insert <li> snippets and have no problems. The suggestion is basically this: create the snippet, open the snippet file in the Internal editor, remove everything within the <body> tags EXCEPT the <li> tags and their text. The resulting numbering you see in the XML Editor is wrong, so don't let it distress you. Go to Preview or build the project and you will see the numbering the way it ought to be.
Tracey
tbean
Propeller Head
 
Posts: 48
Joined: Wed Jan 16, 2008 1:59 pm
Location: SE Pennsylvania


Return to Tips and Tricks

Who is online

Users browsing this forum: No registered users and 3 guests