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

user variables set by conditional statements

New Here ,
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
TOPICS
Structured

Views

1.0K
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
Mentor ,
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

Votes

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
New Here ,
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

Votes

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
Mentor ,
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

Votes

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
New Here ,
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

Votes

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 ,
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

Votes

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
Mentor ,
Mar 05, 2009 Mar 05, 2009

Copy link to clipboard

Copied

LATEST
SK, you could put it on the wish list, but I wouldn't hold your breath waiting. :)

Russ

Votes

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