Skip to main content
June 12, 2012
Question

Making text display with conditional build expression

  • June 12, 2012
  • 2 replies
  • 2871 views

I'm having problems getting images and text strings to display in my single-source outputs. I have strings and images that have multiple build tags applied to them, and when I try to build for one of my SSLs, those strings and images don't show up because of multiple tags applied to them.

For example, I have a string that has the conditions A, B, C, D, and E applied to it. (These are not the actual condition names; just for this thread's purposes). I want to generate the C output and have the string display, even though it has the other conditions applied to it.

Peter Grainge: I read the Build Expressions wiki on your page and tried this combination (C AND NOT A AND NOT B AND NOT D AND NOT E). Sometimes I got the result I expected (the string displayed), and other times not (no string or image displayed), even though strings had the same conditions applied to them.

Any idea why it's not working? Does the order of the conditions matter? e.g., the way you use them on the string, they should appear in that order in the build expression?

This topic has been closed for replies.

2 replies

June 15, 2012

I've also run into this problem and I could not get the build tags to build correctly in an output. If I did it in a simple project, it sometimes worked, but once applied to even a single topic in a larger project, it broke.

What I've found most effective is to use all exclude conditions; tag everything the opposite of what you want it to be. In your example above, if you only have the five conditions applied to a string of text or to images, in the SSL make the output be only NOT A AND NOT B AND NOT D AND NOT E. If you don't specify a build tag in the SSL, it is output in the final build. (EDIT: Granted, with that setup, the text will always output. Even with your original SSL statement, the text will output since it's tagged C.)

Or, as another example, I have stuff needs to be output in only one build for developers and another build for the help users. Anything that is going to be included for the developers is tagged not_help (that's the build tag name). Then in my SSL for the developer output, I don't include this tag. As a result, RH outputs everything (the whole paragraph below in example text is output). For the help build, I have NOT not_help included in the SSL. As a result of that, the help build leaves out the tagged content (only the first sentence of the paragraph below in example text is output).

Example text:

This is an example text. <not_help>This information is not be included in the help.</not_help>

One of our projects contains many such tags for roles (role1, role2, role3, role4, for example). Some topics need to be output for role1 and role3, so for that build expression in the SSL we simply put NOT role2 AND NOT role4. We don't mention the other tags (role1 or role3), so those tags are brought into the output.

It seems to be easier in RH to specify what is not included than to specify what should be included. Once you specify one thing to include, you have to specify them all (at least that's been my experience).

Peter Grainge
Community Expert
Community Expert
June 18, 2012

Generally Exclude expressions are the easiest and are probably the first option to go for but there are times when they will exclude stuff you want in.


See www.grainge.org for RoboHelp and Authoring tips

@petergrainge

Use the menu (bottom right) to mark the Best Answer or Highlight particularly useful replies. Found the answer elsewhere? Share it here.
Peter Grainge
Community Expert
Community Expert
June 19, 2012

Are you thinking it's a path problem for the project folder?


I suspect Rick's thinking was checking on either a network drive or a very long path.

Yes Salesbuilder is from RoboHelp 9 so try whatever shipped with 8.


See www.grainge.org for RoboHelp and Authoring tips

@petergrainge

Use the menu (bottom right) to mark the Best Answer or Highlight particularly useful replies. Found the answer elsewhere? Share it here.
Peter Grainge
Community Expert
Community Expert
June 13, 2012

Difficult one. I don't think the order is important, what matters is what you include and exclude and your expression prima facie makes sense.

I would step away from the real project and set up a simple test project as I did for the expressions download on my site. That often makes is easier to see what is going on and get things working. Then you can apply your expression in your live project.


See www.grainge.org for RoboHelp and Authoring tips

@petergrainge

Use the menu (bottom right) to mark the Best Answer or Highlight particularly useful replies. Found the answer elsewhere? Share it here.