0
user variables set by conditional statements
New Here
,
/t5/framemaker-discussions/user-variables-set-by-conditional-statements/td-p/1248672
Mar 02, 2009
Mar 02, 2009
Copy link to clipboard
Copied
Hello all,
I am new to FM, using FM9p196. I would like to be able to set a user variable based on the value of an attribute.
For example, say I have a highest-level-element named "DOCUMENT" with an attribute color. Color is an optional choice string attribute with choices "black" or "white." I would like to be able to set text within the document to say "The document color number is BW-XXX" or "The document color number is WH-XXX". I thought I might be able to do this with a user variable, but cannot figure out how to put a conditional statement into the definition of the variable (e.g. if color = white, variable = WH-XXX). Is it possible to do this within framemaker, either as some conditional text statement or via a translation table in the reference pages, or some other way?
Thanks for you help.
SK
I am new to FM, using FM9p196. I would like to be able to set a user variable based on the value of an attribute.
For example, say I have a highest-level-element named "DOCUMENT" with an attribute color. Color is an optional choice string attribute with choices "black" or "white." I would like to be able to set text within the document to say "The document color number is BW-XXX" or "The document color number is WH-XXX". I thought I might be able to do this with a user variable, but cannot figure out how to put a conditional statement into the definition of the variable (e.g. if color = white, variable = WH-XXX). Is it possible to do this within framemaker, either as some conditional text statement or via a translation table in the reference pages, or some other way?
Thanks for you help.
SK
TOPICS
Structured
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Mentor
,
/t5/framemaker-discussions/user-variables-set-by-conditional-statements/m-p/1248673#M5268
Mar 03, 2009
Mar 03, 2009
Copy link to clipboard
Copied
SK,
This isn't possible with variables, but it could be done with EDD prefixes. You could define a text range element that applies different prefixes based on an attribute of the HLE. I don't think that you can insert the attribute value directly; rather, you would have to set up a series of context rules with different conditional statements.
This functionality falls into the broader topic of EDD-applied prefixes and context rules that test attribute values. There's lots of info in the Structure Developer's Guide about it.
Russ
This isn't possible with variables, but it could be done with EDD prefixes. You could define a text range element that applies different prefixes based on an attribute of the HLE. I don't think that you can insert the attribute value directly; rather, you would have to set up a series of context rules with different conditional statements.
This functionality falls into the broader topic of EDD-applied prefixes and context rules that test attribute values. There's lots of info in the Structure Developer's Guide about it.
Russ
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
_S_Kempf_
AUTHOR
New Here
,
/t5/framemaker-discussions/user-variables-set-by-conditional-statements/m-p/1248674#M5269
Mar 03, 2009
Mar 03, 2009
Copy link to clipboard
Copied
Russ,
I think I can get that to work. I have created an empty dummy element with prefix / suffix rules based on context to control the content I would like to have. I have also been able to cross-reference the data using $elemtext. Is there any good way to hide the element itself in the actual document, so that the content only appears where it is cross-referenced?
SK
I think I can get that to work. I have created an empty dummy element with prefix / suffix rules based on context to control the content I would like to have. I have also been able to cross-reference the data using $elemtext. Is there any good way to hide the element itself in the actual document, so that the content only appears where it is cross-referenced?
SK
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Mentor
,
/t5/framemaker-discussions/user-variables-set-by-conditional-statements/m-p/1248675#M5270
Mar 04, 2009
Mar 04, 2009
Copy link to clipboard
Copied
SK,
The text will have to appear somewhere, as this is a prerequisite for the cross-reference mechanism in FrameMaker. Otherwise you'd have to use some other type of link trickery, like hypertext markers or something.
The only thing I can think of is to make the text very small and white, or something like that. I don't think this is a very good recommendation in general, though. If you have a large-scale need for this, it might be a job for FrameScript or the FDK.
Russ
The text will have to appear somewhere, as this is a prerequisite for the cross-reference mechanism in FrameMaker. Otherwise you'd have to use some other type of link trickery, like hypertext markers or something.
The only thing I can think of is to make the text very small and white, or something like that. I don't think this is a very good recommendation in general, though. If you have a large-scale need for this, it might be a job for FrameScript or the FDK.
Russ
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
_S_Kempf_
AUTHOR
New Here
,
/t5/framemaker-discussions/user-variables-set-by-conditional-statements/m-p/1248676#M5271
Mar 05, 2009
Mar 05, 2009
Copy link to clipboard
Copied
Russ,
Thank you for your time and suggestions, they were very helpful. I am probably being too clever for my own good by managing content with 1 EDD and 1 template that probably deserves at a minimum 2 templates.
I will also look into the FDK. Do you think it would be worth putting on the "wish list" the ability to use "if" constructs within the attribute definition?
Thanks again for the help,
SK
Thank you for your time and suggestions, they were very helpful. I am probably being too clever for my own good by managing content with 1 EDD and 1 template that probably deserves at a minimum 2 templates.
I will also look into the FDK. Do you think it would be worth putting on the "wish list" the ability to use "if" constructs within the attribute definition?
Thanks again for the help,
SK
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
/t5/framemaker-discussions/user-variables-set-by-conditional-statements/m-p/1248677#M5272
Mar 05, 2009
Mar 05, 2009
Copy link to clipboard
Copied
Hi SK,
An alternative to the FDK is FrameScript (http://www.framescript.com).
Rick Quatro
585-659-8267
An alternative to the FDK is FrameScript (http://www.framescript.com).
Rick Quatro
585-659-8267
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Mentor
,
LATEST
/t5/framemaker-discussions/user-variables-set-by-conditional-statements/m-p/1248678#M5273
Mar 05, 2009
Mar 05, 2009
Copy link to clipboard
Copied
SK, you could put it on the wish list, but I wouldn't hold your breath waiting. :)
Russ
Russ
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

