Single Source (if-else conditional) plugin for confluence can be used for following purpose:
Related Concepts
Create Single Source Content
Use Single Source (if-else) macro to create single source content. Macro interface could be used to provide following parameters
For example macro shown in image every instance of word TYPE in macro body will be shown as Syrup in output if condition is true otherwise every instance of TYPE will be shown as Tablet i.e if condition is false.
As a real life example we are using sample content related to documentation of Ibugesic plus Syrup and Ibugesic plus tablet where most of the content is same except names and some product specific content. Example content and output is as follows:
We can see in image that single source content is created by using keyword TYPE which is replaced by Syrup if condition is true otherwise TYPE is replaced with Tablet in output. Content specific to one version of manual could also be provided using tags as shown in image shown below
As we can see that there are 2 different tables which are specific to Syrup and Tablet respectively. For such specific content SS_TRUE_ST SS_TRUE_END and SS_FALSE_ST SS_FALSE_END tags could be used as shown in example above. Content between TRUE tags will be displayed only if condition is true and content between FALSE tags will be displayed only if condition is false.
Reuse the Content
Single Source content created using single source(if-else) macro could be reused at any other location by using Single Source(if-else) Include macro.
In case there is Single source content which is mostly the same but having slightly differing more than 2 version, please check our Conditional Multiexcerpt plugin.
Credits
Our customers play and important role in making our solution better. Thanks to everyone who provided feedback, suggestions and reported some issues.
Atlassian Marketplace link - Single Source(if-else) plugin