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?
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
...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.
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
[ Import ]
Frame doesn't have auto-updating intra-book global variables. You could fake it with Cross-References.
Copy link to clipboard
Copied
Thanks, this would be a good workaround, but I am really amazed that there are not any global variables.
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).
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
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.
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/
Copy link to clipboard
Copied
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/.