Snippets and ordered lists (OL)

This forum is for Single-Sourcing your Flare content to multiple outputs.
Post Reply
grendel
Propeller Head
Posts: 82
Joined: Fri Mar 15, 2013 2:00 pm
Location: Oklahoma
Contact:

Snippets and ordered lists (OL)

Post by grendel »

I have snippet content that I want to present in the following two ways:

As part of a list of steps in one task/topic
4. text
a. text
b. text
c. text

For the other file, step 4.a. above would be step 1. I want it to do this:
1. text
2. text
3. text

Is there a way to tell the snippet to start at Step 4.a in the first topic, and then start at Step 1 in the other? Or have the snippet inherit the numbering sequence? For instance, if I start with 1., 2., 3. in the snippet, can the snippet renumber as a., b., c. in the other file?

In short, I want the snippet to inherit the number sequence in the destination file.

Thanks in advance,
Lisa

ETA: I'm on Flare 10.2
writeeditconsultingllc.com
WE make writing right.
Nita Beck
Senior Propellus Maximus
Posts: 3669
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Snippets and ordered lists (OL)

Post by Nita Beck »

Easy.

In the snippets, the content needs to be within a paragraph block (<p>). Don't have the content be within an <li>.

In the topics, insert the snippet in the <Ii> where you want it. The bullet/number/letter of the <li> will be controlled by the list item, not by the snippet.

BTW, if you insert the snippet as a snippet block, don't be alarmed that -- in the XML Editor -- the list item's bullet/number/letter will appear to be in the wrong place, such as aligned near the bottom of the <li> block instead of the top. That's a quirk of the XML Editor. The bullet/number/letter will be properly aligned in preview and in output.

Sorry that I'm being very quick. I hope this was enough to help out.
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
nielsf
Propeller Head
Posts: 86
Joined: Mon Feb 02, 2015 5:44 am
Location: Copenhagen, Denmark

Re: Snippets and ordered lists (OL)

Post by nielsf »

Only way I can this to work is by using this scenario:

Code: Select all

<ol>
    <MadCap:snippetBlock src="../../../../../Resources/Snippets/CoA/Trace.flsnp" />
    <li>The country code ... blah.</li>
</ol>
And the snippet looks like this:

Code: Select all

    <body>
        <li>This is an item</li>
        <li>This is another item</li>
        <li>This is the last item in the snippet</li>
    </body>
The snippet can be saved, even though it's not really valid html.
Inserting it takes a little care:
  1. Create the numbered list
  2. Write the item after the snippet
  3. Fiddle with arrow keys until the cursor is between the OL and the first LI tag
  4. Insert the snippet
It will look like this:
NumberedSnippet.png
The numbering will be fine eventually, as mentioned elsewhere in this and other threads.
This way, you don't have to make the list start with any other number than default.
Nita:
In the snippets, the content needs to be within a paragraph block (<p>). Don't have the content be within an <li>.
That is true if you have one snippet per item. If you want multiple items in the snippet, you gotta do it this way. I think... :)
You do not have the required permissions to view the files attached to this post.
-----
Flaring in Copenhagen, Denmark
NorthEast
Master Propellus Maximus
Posts: 6363
Joined: Mon Mar 05, 2007 8:33 am

Re: Snippets and ordered lists (OL)

Post by NorthEast »

In the original post, the snippet is used as a second level list (not continuation of a list).
To do that, the snippet could be included inside the list (li) tag (which is I think what Nita was suggesting).

So the snippet would look like this:

Code: Select all

<ol>
   <li>Text for snippet step a</li>
   <li>Text for snippet step b</li>
   <li>Text for snippet step c</li>
</ol>
To insert it inside a list (as a second level list), it would look like this:

Code: Select all

<ol>

    <li>
        <p>Text for list step 4.</p>
        <MadCap:snippetBlock src="Snippet.flsnp" />
    </li>
</ol>
The numbering of the list should be handled by your CSS; e.g. decimal for first level, and lower-alpha for second level lists:

Code: Select all

ol { list-style-type: decimal; }
ol ol { list-style-type: lower-alpha; }
nielsf
Propeller Head
Posts: 86
Joined: Mon Feb 02, 2015 5:44 am
Location: Copenhagen, Denmark

Re: Snippets and ordered lists (OL)

Post by nielsf »

Yes, that would work when mixing list styles, but not when continuing a list from any place in any list.
To do that, this is the only workable way I cound find.
But when re-reading the original question, I do see that it was about mixing list styles.
-----
Flaring in Copenhagen, Denmark
Post Reply