Skip navigation
StreamFlow
Currently Being Moderated

Global Variables In A Book

May 9, 2012 9:53 AM

I have a book that contains multiple chapters.  The variables that I create seem to only be attached to the chapter that I am in when I create the variable.  How can I create a variable that spans across all chapters of the same book?

 
Replies
  • Currently Being Moderated
    May 9, 2012 10:04 AM   in reply to StreamFlow

    FM doesn't have "global" variables per se. But you can accomplish this by creating a variable template.

     

    First, create a simple FM file that contains only the custom variables you need. Then in the book file select all of the files that you want to have these variables in. Now File > Import > Formats, select the variable template file and select ONLY the "Variable Definitions" item for import.

     

    Tip: create a two-column table in your template file; one to show the variable name and the other to show the actual value of the variable. This makes maintenance easier.

     

    If you ever need to change any of the variable definitions or add more, then just edit the master variable template file and re-import to the book.

     
    |
    Mark as:
  • Currently Being Moderated
    May 9, 2012 10:12 AM   in reply to StreamFlow

    Designate one component file, say Cover.fm, to be the container for variable definitions.

     

    Edit your variables in cover.fm.

     

    From the Book menu, select all component files except Cover.fm

     

    File > Import > Formats

    Import from Document: [ Cover.fm ]

    File > Import > Formats

    [ Deselect All ]

    elect [*] Variable Definitions

    [ Import ]

     

    Frame doesn't have auto-updating intra-book global variables. You could fake it with Cross-References.

     
    |
    Mark as:
  • Currently Being Moderated
    May 9, 2012 12:30 PM   in reply to StreamFlow

    > ... but I am really amazed that there are not any global variables.

     

    Global to what ?

     

    But sure, it would be more than nice if there were Book-level Variables (that auto-propagated).

     
    |
    Mark as:
  • Currently Being Moderated
    May 9, 2012 12:46 PM   in reply to StreamFlow

    If you don't want to maintain it yourself in a template, there also is a plug-in by Scott Prentice from Leximation: BookVars.

     

    See: http://leximation.com/tools/info/bookvars.php

     
    |
    Mark as:
  • Currently Being Moderated
    May 9, 2012 12:53 PM   in reply to StreamFlow

    You might also want to look at the BookVars plugin. It works basically

    the same as the manual method of importing variables from a template,

    but creates the template and menu items to make it a bit easier:

    http://leximation.com/tools/

     
    |
    Mark as:
  • Currently Being Moderated
    May 10, 2012 11:57 AM   in reply to StreamFlow

    I havent used it myself  but you might want to take a look at the  hypervars plugin: http://ig5authoringtools.com/plugin-directory/single-sourcing/hypervar s/.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points