Nested snippets with conditions - is there a bug? WORKROUND

This forum is for Single-Sourcing your Flare content to multiple outputs.
Post Reply
ChoccieMuffin
Senior Propellus Maximus
Posts: 2630
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Nested snippets with conditions - is there a bug? WORKROUND

Post by ChoccieMuffin »

I can't remember clearly, but I seem to remember someone mentioning that if you have a snippet that contains conditions, include that snippet inside another snippet, and then apply conditions to the OUTER snippet, that the conditions don't "stick".

I have a set of conditions and in one set I have PrintOnly and ScreenOnly, and in the other set I have products, e.g. ProductA, ProductB and ProductC.

My INNER snippet is used in quite a few places, and has the following conditions: ProductA PrintOnly, ProductB ScreenOnly, ProductB PrintOnly, ProductB ScreenOnly, ProductC PrintOnly, ProductC ScreenOnly.

I added the inner snippet to the OUTER snippet and didn't apply any snippet conditions there, as the OUTER snippet is used in a few places too.

When I added the outer snippet to a topic for use in Product C, I applied snippet conditions to it to Include ProductC and exclude ProductA and ProductB. Then when generating my Print and Screen outputs I put the PrintOnly and ScreenOnly conditions on the target.

As I see it, if I'm generating a Screen target for ProductC I should be able to apply Include ScreenOnly and Exclude PrintOnly and it should work. Just to make certain I applied advanced snippet conditions to also exclude ProdB and Print, Prod B and Screen, Prod A and Print and Prod A and Screen. But for some reason all three ScreenOnly bits from the inner snippet are included in the output.

Any suggestions? Is this a bug, or have I made things too complicated and missed something?

Update: I converted the inner snippet to text in the outer snippet and that resolved the problem, so that seems to confirm that conditions applied to an outer snippet don't affect an inner snippet. Meh, not happy with that, so I'll just have to report it.
Last edited by ChoccieMuffin on Thu Aug 31, 2017 6:58 am, edited 1 time in total.
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
devjoe
Sr. Propeller Head
Posts: 337
Joined: Thu Jan 23, 2014 1:43 pm

Re: Nested snippets with conditions - is there a bug?

Post by devjoe »

Includes override excludes. If you include something, it will always go in even if there are excluded conditions on it. Most of the time you do not want to use includes, and only want excludes.
ChoccieMuffin
Senior Propellus Maximus
Posts: 2630
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Nested snippets with conditions - is there a bug?

Post by ChoccieMuffin »

I have submitted a bug, though I know a bug has already been submitted about this.

My only solution (Grrr!!!) is to convert the inner snippets to text, which has me very fed up because I have oodles of 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
ChoccieMuffin
Senior Propellus Maximus
Posts: 2630
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Nested snippets with conditions - is there a bug? WORKRO

Post by ChoccieMuffin »

Hi all

After a bit of digging I notice that the bug happens if you apply the snippet condition inside the topic to the outer snippet. If you apply the snippet condition to the topic itself, then it seems to behave itself.

Obviously there's still a bug which needs to be investigated, but this might be a kinda-sorta workround that you can use.

I'm currently trying to strip down a huge project so I can send it to them to play with and it's taking ages, so when I get a more detailed reply I'll let you know.
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