Export a file twice to a single output with dif conditions?

This forum is for Single-Sourcing your Flare content to multiple outputs.
Post Reply
aritchie
Jr. Propeller Head
Posts: 2
Joined: Thu Sep 20, 2018 7:29 am

Export a file twice to a single output with dif conditions?

Post by aritchie »

I would like to be able to use a file twice to the same HTML output, where the first use applies image A and the second use applies image B. Will I be able to do this?

In my TOC, I am able to insert the same file twice. Using the Properties tab, I can then assign the first placement of the file in the TOC the condition that will use image A. For the second placement of the file, I can assign the other condition that will use image B. When I build the target, however, both versions of the file include both image A and image B.

I have only started to use conditions, but it seems I can't apply different conditions to single file for the same target. The file can appear twice but has to output to the same condition.
SteveS
Senior Propellus Maximus
Posts: 2089
Joined: Tue Mar 07, 2006 5:06 pm
Location: Adelaide, far side of the world ( 34°56'0.78\"S 138°46'44.28\"E).
Contact:

Re: Export a file twice to a single output with dif conditio

Post by SteveS »

Welcome to the forums :D

Have you considered applying the conditions to the images?

You can use conditions to say use this image for this output but not the other output.

Edit:
Now I've read your post again I can see I misunderstood. @Psider is on the right track.
Image
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
Psider
Propellus Maximus
Posts: 815
Joined: Wed Jul 06, 2011 1:32 am

Re: Export a file twice to a single output with dif conditio

Post by Psider »

If you need different images for the same topic in a single output, the only way I can think of is create two snippets of the content before and after the specific image, then include those snippets in two different topics and insert the relevant image between the snippets. Then insert those two topics into the relevant place in the TOC.
ChoccieMuffin
Senior Propellus Maximus
Posts: 2632
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Export a file twice to a single output with dif conditio

Post by ChoccieMuffin »

Psider wrote:If you need different images for the same topic in a single output, the only way I can think of is create two snippets of the content before and after the specific image, then include those snippets in two different topics and insert the relevant image between the snippets. Then insert those two topics into the relevant place in the TOC.
I would do it slightly differently, and once you've created the condition tag set the solution can be used in as many places as needed.

* Create a condition tag set called "snippet_conditions.flcts" or similar. (This is just helpful practice, so you keep snippet conditions separate from conditions you use in targets or imports.) In that condition tag set, create two conditions, for the sake of argument let's call them A and B.
* Create two separate topics, one for A and one for B, and include each topic in the correct places in the TOC. (This is also good practice, as it means any breadcrumbs you have in your help point to the correct place in the TOC - if you have the same topic in two places, breadcrumbs don't recognise which instance you want if you find the topic when using search.) I like to include the first heading in the topic, but this isn't essential.
* Create a snippet that contains the body text and both images, and apply the appropriate snippet condition to each image. (If you have other things, like bits of text, that differ between A and B you can also include both bits of text and apply your snippet conditions as appropriate.)
* Insert the snippet into each topic. At first, both images appear, but don't fret - here's the clever bit...
* In each topic, in the structure bar right-click the snippet and on the menu click Snippet conditions, and in the dialog box select the appropriate condition from the condition tag set you created earlier.
* When generating your target, completely ignore the snippet_conditions tag set - you've already dealt with them at the topic level.

Once you've created the condition tag set you can use the same solution anywhere you need to, and you don't need TWO (or more) snippets for the topic content just in order to use different images.
Started as a newbie with Flare 6.1, now using Flare 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
aritchie
Jr. Propeller Head
Posts: 2
Joined: Thu Sep 20, 2018 7:29 am

Re: Export a file twice to a single output with dif conditio

Post by aritchie »

Wow, what a response! I didn't expect replies so soon. Thanks for also interpreting my use of the term "file" as topic, which is what I meant. I didn't think to use snippets in this way and apply conditions to them, as ChoccieMuffin outlined. It sounds like I still need to create two topics, but with the use of snippets I can still try to make the most of single-sourcing. Thank you, everyone.
Psider
Propellus Maximus
Posts: 815
Joined: Wed Jul 06, 2011 1:32 am

Re: Export a file twice to a single output with dif conditio

Post by Psider »

Oh yeah, I keep forgetting snippet conditions, as they didn't exist when I was using Flare regularly. :)
ChoccieMuffin
Senior Propellus Maximus
Posts: 2632
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Export a file twice to a single output with dif conditio

Post by ChoccieMuffin »

aritchie wrote:Wow, what a response! I didn't expect replies so soon. Thanks for also interpreting my use of the term "file" as topic, which is what I meant. I didn't think to use snippets in this way and apply conditions to them, as ChoccieMuffin outlined. It sounds like I still need to create two topics, but with the use of snippets I can still try to make the most of single-sourcing. Thank you, everyone.
Snippet conditions have been a godsend! And yes, two topics but the content of them is basically Line 1 = title, Line 2 = link to snippet. Piece of cake! Do hunt in the Flare help for snippet conditions to get a thorough explanation of them, and how to use them.
Started as a newbie with Flare 6.1, now using Flare 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Post Reply