Nested Targets for different conditions within one output

This forum is for Single-Sourcing your Flare content to multiple outputs.
Post Reply
sviviers
Jr. Propeller Head
Posts: 5
Joined: Mon May 17, 2010 5:05 am

Nested Targets for different conditions within one output

Post by sviviers »

I'm trying to find a way to set conditions differently on two sets of topics in one target.

I have some help text about a single process that can be done in two different tools.
The result I want to achieve is to have one source topic of the process ("Creating XYZ"), but output two topics ("Creating XYZ - tool1" and "Creating XYZ - tool2"). I have two different TOCs for these two variations (one for tool1 and one for tool2), and both TOCs get called into a master TOC along with everything else for a single target.

For instance, a topic will have some generic text that applies to both tools, but then also have specific instructions and images for tool1 and tool2, with conditions applied. Users choosing to look at the output for tool1 would ideally see in this topic the generic text and the instructions and images under the tool1 condition, but not the instructions and images under the tool2 condition. The same topic will also appear in the output for tool2, but this instance will have the tool2 condition visible and the tool1 condition hidden.

Summary:
[*]Target - Webhelp Plus online help output (with a number of TOCs called and a number of conditions globally applied)
[*]TOC1 - Creating XYZ - tool1
[*]TOC2 - Creating XYZ - tool2
[*]Condition1 - tool1
[*]Condition2 - tool2

How can I set it up so that condition2 is excluded in tool1's topic and condition1 is excluded in tool2's topic? Is nesting targets an option?
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Nested Targets for different conditions within one output

Post by NorthEast »

You might have already realised this, but you can only have one variant of a single topic in one output. You can't generate both variants from a single file in the same output, as the conditions are set at the target level.
For example, you can have Creating XYZ - tool1 or Creating XYZ - tool2, based on your target condition settings, but you can't have both variants in the output.

Anyway, the short answer is to create the content in a snippet, place the snippet in separate topics, then set the snippet conditons for each topic.

To do this...
1) Create a snippet (e.g. Creating XYZ) and include all of the topic text, with the conditional text for both variants.
2) Create two separate topics, e.g. Creating XYZ - tool1 and Creating XYZ - tool2.
3) Place the snippet in each topic.
4) In each topic, go to the topic properties Snippet Conditions tab. Use this to select which conditions to use for the snippet in that topic, i.e. exclude tool1 or tool2.
sviviers
Jr. Propeller Head
Posts: 5
Joined: Mon May 17, 2010 5:05 am

Re: Nested Targets for different conditions within one output

Post by sviviers »

Thanks for that! I tried it before, reluctantly (as I didn't want to create an extension of the topic collection in the snippets area really). But that reservation was a moot point, as it didn't seem to work at all.

I may be doing something wrong if you've had success with that method. Is there a known bug on this issue (I couldn't find one), or perhaps something else one needs to do (other than ensure the conditioned text in the snippet is marked when that snippet is called into the topic)?

Thanks again
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Nested Targets for different conditions within one output

Post by NorthEast »

It works fine for me.
What exactly happened when you tried it - e.g. did it exclude text with the wrong condition, both conditions, or not exclude anything?

Did you check the settings on the Snippet conditions tab for each topic's properties?
The snippet condition settings are reflected in the editor, so you can check in the editor that the right text is displayed.

Also, check you've not excluded either condition in the target, as that'll exclude the conditioned text whether it's in a snippet or not.
sviviers
Jr. Propeller Head
Posts: 5
Joined: Mon May 17, 2010 5:05 am

Re: Nested Targets for different conditions within one output

Post by sviviers »

Aha! Success. I was editing the source in Dreamweaver, including the condition markup in the snippet reference in each topic (which didn't work). But when I tried it in the GUI that Flare has (file properties > snippet condition for each topic, it worked.

Bizarre that one method fails and the other is fine, unless the information for the file properties is stored someplace else of course (I haven't looked too closely).

Thanks for the help, much appreciated
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Nested Targets for different conditions within one output

Post by NorthEast »

sviviers wrote:Aha! Success. I was editing the source in Dreamweaver, including the condition markup in the snippet reference in each topic (which didn't work). But when I tried it in the GUI that Flare has (file properties > snippet condition for each topic, it worked.

Bizarre that one method fails and the other is fine, unless the information for the file properties is stored someplace else of course (I haven't looked too closely).

Thanks for the help, much appreciated
Ah, it wouldn't work if you applied the condition to the snippet tag in the topic itself (<MadCap:snippetBlock...) - that'd exclude the entire snippet.

The snippet condition setting applies to the whole topic, i.e. all snippets in the topic, and in the code it's set in the html tag (MadCap:conditionTagExpression="...).
sviviers
Jr. Propeller Head
Posts: 5
Joined: Mon May 17, 2010 5:05 am

Re: Nested Targets for different conditions within one output

Post by sviviers »

That's where it's hiding! Good to know :)

What I find peculiar is that the property set in the html looks like a generic exclusion of a condition (MadCap:conditionTagExpression="exclude[Default.XYZ1]), but it only successfully excludes text that is conditioned as XYZ1 in a snippet rather than in the topic itself. I can't see any obstacle to having conditions at topic level that override general conditions in a target without using snippets, yet this only works with snippets. If there is no obstacle, the idea of nested targets or cascading conditions strikes me as a more manageable way of single-sourcing things than making snippets for everything that you want to share across topics in this way. Maybe I'll put in a feature request.

FYI and because I didn't answer your previous post thoroughly: before the file property snippet condition setting was applied the output included everything (or rather, it failed to exclude anything).
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Nested Targets for different conditions within one output

Post by NorthEast »

sviviers wrote:I can't see any obstacle to having conditions at topic level that override general conditions in a target without using snippets, yet this only works with snippets. If there is no obstacle, the idea of nested targets or cascading conditions strikes me as a more manageable way of single-sourcing things than making snippets for everything that you want to share across topics in this way. Maybe I'll put in a feature request.
I see where you're coming from, but figuring out how that could work makes my head hurt.

Say you had a single topic that contained text using two conditions. Flare would need to generate two separate versions of topic file in the output - one for each condition. (I'm also not sure what controls that, i.e. where could you logically set which variants of a topic to generate?)

So, if your one source topic is now two separate files in the output, how do things like links work? If you had a link to that topic, which version of the topic in the output should it link to?

Anwyay, the more I think about it, the more complicated it seems!
sviviers
Jr. Propeller Head
Posts: 5
Joined: Mon May 17, 2010 5:05 am

Re: Nested Targets for different conditions within one output

Post by sviviers »

I know what you mean, if one goes down the route of trying to have one topic only (e.g. strictly enforcing a true single source) while not creating a riot of snippets, chaos with conditions or general brain melt, it tends to end up with a hack somewhere.

thanks for the help though
Post Reply