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

This forum is for Single-Sourcing your Flare content to multiple outputs.

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

Postby aritchie on Tue Mar 05, 2019 1:23 pm

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

Postby SteveS on Tue Mar 05, 2019 4:39 pm

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.
SteveS
Propellus Maximus
 
Posts: 1959
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).

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

Postby Psider on Tue Mar 05, 2019 5:17 pm

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.
Psider
Propellus Maximus
 
Posts: 550
Joined: Wed Jul 06, 2011 1:32 am

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

Postby ChoccieMuffin on Wed Mar 06, 2019 3:50 am

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 2019r1.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
ChoccieMuffin
Senior Propellus Maximus
 
Posts: 2025
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

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

Postby aritchie on Wed Mar 06, 2019 6:51 am

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

Postby Psider on Wed Mar 06, 2019 4:15 pm

Oh yeah, I keep forgetting snippet conditions, as they didn't exist when I was using Flare regularly. :)
Psider
Propellus Maximus
 
Posts: 550
Joined: Wed Jul 06, 2011 1:32 am

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

Postby ChoccieMuffin on Mon Mar 11, 2019 3:21 am

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 2019r1.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
ChoccieMuffin
Senior Propellus Maximus
 
Posts: 2025
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK


Return to Single-Sourcing

Who is online

Users browsing this forum: No registered users and 1 guest