Omni Systems, Inc.

  

Mif2Go User's Guide, Version 55

  

Valid HTML 4.01!

 

Made with Mif2Go

28 Working with macros > 28.3 Using macro variables > 28.3.7 Creating macro variables from paragraph content > 28.3.7.1 Capturing paragraph content with the TextStore property


28.3.7.1 Capturing paragraph content with the TextStore property

To store the text content of a FrameMaker paragraph in a macro variable, assign the TextStore property to the paragraph format:

[HTMLParaStyles]

; TextStore stores the paragraph content as plain text in the

; macro variable named in [StyleTextStore].

Parafmt = TextStore

Explicitly assigning the TextStore property to a paragraph format is optional when you assign a macro variable to that format in the following section:

[StyleTextStore]

; doc para format = name of macro variable in which to store para text

; if omitted, default is a macro variable of the para format name

Parafmt = Varname

Format name is default variable name

If you assign the TextStore property to a paragraph format, but you do not supply a macro variable name in section [StyleTextStore], Mif2Go uses the paragraph format name itself as the macro variable name.

Plain text

TextStore macro variables contain just plain text; no HTML tags, RTF formatting code, macros, frames, or tables. Although the original paragraph content is left in place, you can suppress its appearance in output by also assigning the Delete property to the paragraph format.

Only last instance counts

If more than one instance of a TextStore paragraph format appears in a portion of your document destined for a given split or extract file, the TextStore macro variable retains the content of only the last instance, for that particular split or extracted file.

Location can follow point of use

For HTML, you can place a TextStore paragraph anywhere with respect to where you want the macro-variable content to be used, within the limits of material to be split or extracted into a single HTML output file; this is different from CodeStore paragraphs, which must precede the point of use (see §28.3.7.3 Understanding why TextStore and CodeStore work differently).

Content is persistent

The content of a TextStore macro variable persists unchanged in, and is available throughout, each HTML output file. If there is no instance of the paragraph format in the current split file, Mif2Go uses the content of the previous instance (or even a later instance) rather than come up empty-handed. Therefore, to prevent its use in a given split file, you must set the value to zero in that portion of the source document.

Use for HTML navigation links

Suppose you want your HTML output to include Prev and Next links between FrameMaker chapter files. You could create two special paragraph formats for this purpose; for example, PrevChap and NextChap. In each FrameMaker file you would include a single PrevChap paragraph containing the file name (base file name with extension .htm instead of .fm) of the preceding chapter, and a single NextChap paragraph containing the file name of the following chapter.

For example, suppose your book file contains the following files:

Title.fm

Preface.fm

ChapOne.fm

ChapTwo.fm

...

You might give ChapOne.fm a PrevChap paragraph with content Preface.htm, and a NextChap paragraph with content ChapTwo.htm. Most likely you would apply a condition to these paragraphs to prevent them from appearing in printed output.

In the configuration file you would assign the TextStore property to each of these paragraph formats, and include macros for the between-chapter Prev and Next links:

[HTMLParaStyles]

PrevChap=TextStore Delete

NextChap=TextStore Delete

[AtStart]

<p><a href="$$PrevChap">Prev</a></p>

[AtEnd]

<p><a href="$$NextChap">Next</a></p>

The Delete property ensures that PrevChap and NextChap paragraph content does not also appear in the output as regular text.



28 Working with macros > 28.3 Using macro variables > 28.3.7 Creating macro variables from paragraph content > 28.3.7.1 Capturing paragraph content with the TextStore property