snippets & conditions
-
- Sr. Propeller Head
- Posts: 225
- Joined: Wed Aug 08, 2007 3:04 am
- Location: In a galaxy far, far away
snippets & conditions
Hello everyone
I am working on a project with 6 different targets (all HTML Help), depending on the software incarnation. Some functionality and screenshots are generic but each product has got its own specificities. Some topics are common to all 6 products but some require some conditions in parts of them (I have applied some conditions at content level), and some are only valid for a product (I have applied conditions at topic level).
I have one paragraph that is present in most topics. I have created a snippet for it. The snippet itself has conditional text as if most of the content is common, some terms only apply to a specific software incarnation.
This does not seem to work, i.e. the snippet conditions (I have not applied any conditions to the snippet file itself as it is used in the 6 help files) do not seem to be applied in the way I was expected them to. Within the snippet, the words to which "Incarnation A" condition has been applied to do not appear in the output for incarnation A. It looks like any conditional text within my snippet is not shown for any incarnation.
Am I doing things right or do I need to create 6 snippets, one for each software incarnation without any conditions at text level, but a condition at snippet level?
Thanks in advance for your help.
I am working on a project with 6 different targets (all HTML Help), depending on the software incarnation. Some functionality and screenshots are generic but each product has got its own specificities. Some topics are common to all 6 products but some require some conditions in parts of them (I have applied some conditions at content level), and some are only valid for a product (I have applied conditions at topic level).
I have one paragraph that is present in most topics. I have created a snippet for it. The snippet itself has conditional text as if most of the content is common, some terms only apply to a specific software incarnation.
This does not seem to work, i.e. the snippet conditions (I have not applied any conditions to the snippet file itself as it is used in the 6 help files) do not seem to be applied in the way I was expected them to. Within the snippet, the words to which "Incarnation A" condition has been applied to do not appear in the output for incarnation A. It looks like any conditional text within my snippet is not shown for any incarnation.
Am I doing things right or do I need to create 6 snippets, one for each software incarnation without any conditions at text level, but a condition at snippet level?
Thanks in advance for your help.
Re: snippets & conditions
I suppose, you have set the appropriate snippet condition in the topics that you insert the snippet into?
-
- Sr. Propeller Head
- Posts: 225
- Joined: Wed Aug 08, 2007 3:04 am
- Location: In a galaxy far, far away
Re: snippets & conditions
I have but I have an issue for common topics. Let's say I have topic X which is valid for all the software incarnations (A to F).
By going to Properties on that topic and by opening the Snippet Conditions tab, I have clicked on all my snippet conditions : snippet.A to snippet.F as the topic is common. Then, on the target conditional text for software incarnation A (Target > HTML Help incarnation A), I have only included snippet.A and have excluded conditions snippet.B to snippet.F. So theoretically, when I build the target for A, I should only see conditional text snippet.A for topic X, which I do not (I can see all of the snippet conditions)...
Is this normal?
By going to Properties on that topic and by opening the Snippet Conditions tab, I have clicked on all my snippet conditions : snippet.A to snippet.F as the topic is common. Then, on the target conditional text for software incarnation A (Target > HTML Help incarnation A), I have only included snippet.A and have excluded conditions snippet.B to snippet.F. So theoretically, when I build the target for A, I should only see conditional text snippet.A for topic X, which I do not (I can see all of the snippet conditions)...
Is this normal?
Marie-Claire
Flare 2019 r2 - Windows 10 Pro - HTML5 help / "clean" XHTML output
Flare 2019 r2 - Windows 10 Pro - HTML5 help / "clean" XHTML output
-
- Propellus Maximus
- Posts: 1985
- Joined: Tue Jan 23, 2007 8:18 am
- Location: Darn, I knew I was around here somewhere...
Re: snippets & conditions
I think what I would do is remove the snippet condition selections from the topic (i.e. no includes or excludes). Control the includes and excludes in the output target only.
I think what is happening is the include you have for all conditions at the topic level is over-riding the excludes at the target level. (This makes some sense, for two reasons: 1) afaik includes always over-ride excludes, and 2) it follows the CSS principle that parameters that are closer to the text take precedence over parameters that are higher in the cascade.)
I think what is happening is the include you have for all conditions at the topic level is over-riding the excludes at the target level. (This makes some sense, for two reasons: 1) afaik includes always over-ride excludes, and 2) it follows the CSS principle that parameters that are closer to the text take precedence over parameters that are higher in the cascade.)
Until next time....
Kevin Amery
Certified MAD for Flare
Kevin Amery
Certified MAD for Flare
-
- Sr. Propeller Head
- Posts: 225
- Joined: Wed Aug 08, 2007 3:04 am
- Location: In a galaxy far, far away
Re: snippets & conditions
Hi Kevin
Thanks for your help. Your suggestion seems to work, except for two topics which no matter what I do to do (I have removed all the includes and excludes at topic level, then re-inserted the snippet and made sure the snippet conditions were set up to the correct incarnation of the software at output level) are displaying the snippet with all the conditional text and not just the one I wanted...
Thanks for your help. Your suggestion seems to work, except for two topics which no matter what I do to do (I have removed all the includes and excludes at topic level, then re-inserted the snippet and made sure the snippet conditions were set up to the correct incarnation of the software at output level) are displaying the snippet with all the conditional text and not just the one I wanted...
Marie-Claire
Flare 2019 r2 - Windows 10 Pro - HTML5 help / "clean" XHTML output
Flare 2019 r2 - Windows 10 Pro - HTML5 help / "clean" XHTML output
-
- Propellus Maximus
- Posts: 1985
- Joined: Tue Jan 23, 2007 8:18 am
- Location: Darn, I knew I was around here somewhere...
Re: snippets & conditions
If it's just happening with the two topics, I would suspect something is weird with those topic files. I can see two ways to get out of it:
1) Open a topic that works and one of the problem topics in the internal text editor (or another text editor of your choice). Check the code to see if there's anything different about them.
OR
2) Create new topics and copy the text from the problem topics into the new ones.
Number two is probably the faster method.
1) Open a topic that works and one of the problem topics in the internal text editor (or another text editor of your choice). Check the code to see if there's anything different about them.
OR
2) Create new topics and copy the text from the problem topics into the new ones.
Number two is probably the faster method.
Until next time....
Kevin Amery
Certified MAD for Flare
Kevin Amery
Certified MAD for Flare
-
- Sr. Propeller Head
- Posts: 225
- Joined: Wed Aug 08, 2007 3:04 am
- Location: In a galaxy far, far away
Re: snippets & conditions
Hi Kevin
Thanks for your suggestions. As a matter of fact, I have compared files in my text editor and there isn't anything obvious. I will probably have to implement your solution n.2.
Thanks for your suggestions. As a matter of fact, I have compared files in my text editor and there isn't anything obvious. I will probably have to implement your solution n.2.
Marie-Claire
Flare 2019 r2 - Windows 10 Pro - HTML5 help / "clean" XHTML output
Flare 2019 r2 - Windows 10 Pro - HTML5 help / "clean" XHTML output
Re: snippets & conditions
Those topics with the problem - are they in a folder that has conditions assigned?
-
- Sr. Propeller Head
- Posts: 225
- Joined: Wed Aug 08, 2007 3:04 am
- Location: In a galaxy far, far away
Re: snippets & conditions
Hi there
No, these topics are in the same folder as the ones for which the snippet conditions are working. The XML is very similar in the topics that are working and in the ones with the issue. I have created new topics and some of them are exhibiting the same problem. I really do not understand what is going on...
Whenever I get a chance, I will have to investigate this, and may have to resort to Kevin's solution.
No, these topics are in the same folder as the ones for which the snippet conditions are working. The XML is very similar in the topics that are working and in the ones with the issue. I have created new topics and some of them are exhibiting the same problem. I really do not understand what is going on...
Whenever I get a chance, I will have to investigate this, and may have to resort to Kevin's solution.
Re: snippets & conditions
It is quite an old thread, but I wonder if you eventually solve your trouble - at least if you find out what was wrong with the 2 recalcitrant topics.
I also use snippets with conditional tags to display the specific product incarnation depending on the selected target. These snippets used to work perfectly well, except in 1 single topic. I run a battery of (blind) tests and finally identified what was - and still - causing the trouble : tables. As long as my topic only contains 1 single table, the snippet works exactly as expected and only displays the selected incarnation. As soon as I introduce a second table, the snippet freaks out and displays all the incarnations, whatever the target.
Maybe if you still have the 2 problematic topics at disposal, you could check if they contain more than one tables too... That would not solve the problem but will maybe help understanding it !
Anyway, if you could suggest a solution, I would be glad to hear about it !
Thank's in advance,
DoCo
I also use snippets with conditional tags to display the specific product incarnation depending on the selected target. These snippets used to work perfectly well, except in 1 single topic. I run a battery of (blind) tests and finally identified what was - and still - causing the trouble : tables. As long as my topic only contains 1 single table, the snippet works exactly as expected and only displays the selected incarnation. As soon as I introduce a second table, the snippet freaks out and displays all the incarnations, whatever the target.
Maybe if you still have the 2 problematic topics at disposal, you could check if they contain more than one tables too... That would not solve the problem but will maybe help understanding it !
Anyway, if you could suggest a solution, I would be glad to hear about it !
Thank's in advance,
DoCo
-
- Propellus Maximus
- Posts: 1979
- Joined: Tue Nov 28, 2006 11:18 am
- Location: Crossroads of the West
- Contact:
Re: snippets & conditions
DoCo,
Welcome to the forums. This sounds like an issue that MadCap Support would want to know about, especially if you can replicate it in multiple projects. You should start by logging a bug here: https://www.madcapsoftware.com/bugs/submit.aspx
Welcome to the forums. This sounds like an issue that MadCap Support would want to know about, especially if you can replicate it in multiple projects. You should start by logging a bug here: https://www.madcapsoftware.com/bugs/submit.aspx
Re: snippets & conditions
Done !
I hope it will lead to a happy end...
Anyway, thanks for the welcoming ! I have been reading this forum for quite a long time and I found here many helpful tips... Maybe one day I will be able to post useful tips myself in return !
DoCo
I hope it will lead to a happy end...
Anyway, thanks for the welcoming ! I have been reading this forum for quite a long time and I found here many helpful tips... Maybe one day I will be able to post useful tips myself in return !
DoCo
Re: snippets & conditions
Hi,
The Support informed me that was fixed in Flare V4.
I have just upgraded from 3.1 to 4.2 and tried out: indeed, no more trouble with conditional Tag in Snippets in multi-tables Topic.
Happy end !(assuming adopting Flare V4)
DoCo
The Support informed me that was fixed in Flare V4.
I have just upgraded from 3.1 to 4.2 and tried out: indeed, no more trouble with conditional Tag in Snippets in multi-tables Topic.
Happy end !(assuming adopting Flare V4)
DoCo
-
- Sr. Propeller Head
- Posts: 225
- Joined: Wed Aug 08, 2007 3:04 am
- Location: In a galaxy far, far away
Re: snippets & conditions
Hi thereDoCo wrote: Anyway, if you could suggest a solution, I would be glad to hear about it !
DoCo
Sorry, have not been browsing the forums lately. My workaround to this was to create 6 different snippets so I had no conditions on these for the problematic topics. These topics do not have tables. I now use Flare v4 but am still using my different snippets as they work fine. Sorry not to be of more help.
Marie-Claire
Flare 2019 r2 - Windows 10 Pro - HTML5 help / "clean" XHTML output
Flare 2019 r2 - Windows 10 Pro - HTML5 help / "clean" XHTML output