• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Global Variables In A Book

Community Beginner ,
May 09, 2012 May 09, 2012

Copy link to clipboard

Copied

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?

Views

2.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , May 09, 2012 May 09, 2012

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

...

Votes

Translate

Translate
LEGEND ,
May 09, 2012 May 09, 2012

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 09, 2012 May 09, 2012

Copy link to clipboard

Copied

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.

    Votes

    Translate

    Translate

    Report

    Report
    Community guidelines
    Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
    community guidelines
    Community Beginner ,
    May 09, 2012 May 09, 2012

    Copy link to clipboard

    Copied

    Thanks, this would be a good workaround, but I am really amazed that there are not any global variables.

    Votes

    Translate

    Translate

    Report

    Report
    Community guidelines
    Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
    community guidelines
    Community Expert ,
    May 09, 2012 May 09, 2012

    Copy link to clipboard

    Copied

    > ... 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).

    Votes

    Translate

    Translate

    Report

    Report
    Community guidelines
    Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
    community guidelines
    Community Beginner ,
    May 10, 2012 May 10, 2012

    Copy link to clipboard

    Copied

    Variables that are global to the book would be great.  Manually editing a variables in each of 26+ chapters of a book is a real pain in the ass.

    Tom Burke

    Votes

    Translate

    Translate

    Report

    Report
    Community guidelines
    Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
    community guidelines
    LEGEND ,
    May 09, 2012 May 09, 2012

    Copy link to clipboard

    Copied

    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

    Votes

    Translate

    Translate

    Report

    Report
    Community guidelines
    Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
    community guidelines
    Advocate ,
    May 09, 2012 May 09, 2012

    Copy link to clipboard

    Copied

    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/

    Votes

    Translate

    Translate

    Report

    Report
    Community guidelines
    Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
    community guidelines
    Participant ,
    May 10, 2012 May 10, 2012

    Copy link to clipboard

    Copied

    LATEST

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

    Votes

    Translate

    Translate

    Report

    Report
    Community guidelines
    Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
    community guidelines