Page 1 of 1

Ok to apply condition to snippet, then again inside a topic?

Posted: Thu Apr 23, 2020 3:13 pm
by kearnine
We have some snippets that are conditioned for different things. It's a bummer that the color of a conditioned snippet doesn't appear on the snippet when you insert it into a topic. Our team wants to continue conditioning an entire snippet and we want to then apply the condition again on the snippet after it's inserted into a topic so we can see the color there, too. Is there any drawback to applying a condition twice like that? Just want to make sure....

Re: Ok to apply condition to snippet, then again inside a to

Posted: Fri Apr 24, 2020 8:26 am
by Chicago_HPT
It sounds like you may want to take a look at Snippet Conditions. Once I got the hang of them, I started using them extensively. They're extraordinarily useful.

I hope that helps,
-jeff

Re: Ok to apply condition to snippet, then again inside a to

Posted: Mon Apr 27, 2020 1:53 am
by ChoccieMuffin
Are you applying a condition to the entire snippet in File Explorer? If so, what is your reasoning for doing so? In this case you're right, when you insert a snippet where the condition has been applied at the file level (if you look at the snippet in a text editor the condition is in the <html> line) into a topic, the condition doesn't show up. If, on the other hand, you apply the condition to the content of the snippet, then the condition does show up.

As for whether it's a problem, I can only see a problem if you decide at some stage to change how you want to use the snippet, and that at some stage the double conditions might come back to bite you when you can't figure out why it's not showing up.

I think Chicago_HPT has a very valid point, and snippet conditions sound like something well worth investigating for you. Good luck.

Re: Ok to apply condition to snippet, then again inside a to

Posted: Mon Apr 27, 2020 4:15 pm
by kearnine
Thanks, both of you. I wound up calling Madcap Support and we decided that snippet conditions aren't quite the thing for this, which is too bad because our team has been looking for ways to use those.

We have been applying the conditions to the snippet file purely because the colors help us identify them more easily in the Content Explorer. Maybe a dumb reason because it's not a best practice. I think that's the lesson learned here. We'll just apply the condition once we bring it into the topic.

I appreciate your thoughts and help very much!

Re: Ok to apply condition to snippet, then again inside a to

Posted: Mon May 11, 2020 5:26 am
by ChoccieMuffin
kearnine wrote: ...
We have been applying the conditions to the snippet file purely because the colors help us identify them more easily in the Content Explorer.
....
Another suggestion for you is to develop a naming convention for your snippets which will help you identify them, rather than using conditions that might trip you up elsewhere.

Re: Ok to apply condition to snippet, then again inside a to

Posted: Mon May 11, 2020 6:59 am
by RStreets
kearnine wrote:We have been applying the conditions to the snippet file purely because the colors help us identify them more easily in the Content Explorer.
Maybe you could create subfolders in the snippets folder for the different condition names and place the snippets in these?

Re: Ok to apply condition to snippet, then again inside a to

Posted: Mon May 11, 2020 8:37 am
by kearnine
That’s a great idea, too. Thank you!