Tip:
Highlight text to annotate it
X
As you know by now, a project can easily contain thousands and thousands
of topics and when you generate a project all of those topics are going to be compiled.
But what if you want to exclude several topics, or even content from a topic?
To create different versions of a project, you could duplicate the project and
make those changes, but an even better option is to use conditional build tags
where you can pick and choose what's going to be included in a different version of
your project when it's compiled.
That's what we're going to talk about right now using a new project here
called Using LDC Tags.
You can see I've gone to the Table of Contents here.
I have expanded Troubleshooting and double-clicked Searching FAQs, and this is
where we're going to start.
So let's say that when we generate this project we want to be able to generate
a condensed version that doesn't include every single topic and every bit of
content in those topics.
Starting with our Searching topic here, as we scroll down through the text, we
eventually arrived at a sentence where maybe we want to cut things off.
So as we scroll down, let's go down to where it says, "For instance."
Right at the end of that particular sentence, it says, "How do I fix this?"
We'll click there and hit Enter a couple of times.
So that creates a new paragraph, and we can see the space now. Maybe this is the
content we don't want to include in our condensed version.
So all we have to do is apply a conditional build tag to it.
First step though, is to select the content we don't want.
Once we have it selected, you'll notice down in the bottom left-hand corner a
tab for the Conditional Build Tags pod.
Give that a click, and you actually see there is two already here:
one for print and one for online.
So if you wanted an online version of your project that looks different than the
print version, you can apply these tags.
You also have the ability to create new ones by clicking the green tag just
above the two that come with your Conditional Build Tags pod.
So we'll click that to create a new one, and let's just call this one Condensed.
We'll type that in.
We can change the color of the tag, which you can see it's actually going to
turn out a dark blue, so we'll click OK, and there's our new tag.
So now to apply the tag, well, we could click and drag it right over our selected
text--that's one option--and when you let go it, actually becomes a tag.
To see that, just deselect and you'll see all of the shading that covers your
selected text in the color of the tag.
You can also see over here in our pod that we know that this tag is being used
because it too has some shading.
So that's applying it to selected text within a topic. What if we want to apply
to an entire topic altogether?
Well, in that case we could just go to the topic itself, in the Table of
Contents, for example, and right-click.
Let's say we want to go up to Managing Your Account here and when it comes to
reactivating, we don't want to include that in our condensed version.
So we right-click the topic, and you can see down at the bottom there's an
option here to Apply Conditional Build Tags.
You do see the three tags that you have, the two that are there by default plus
the new one, and there is also an option down below if you want to create a new
build tag or select multiple tags.
Let's go to New/Multiple because this is kind of important.
We can choose from two different check boxes for our topic.
Remember, we've right-clicked Reactivating your Account. To exclude it from
the TOC, we can click there. To also exclude the topic altogether, we click the Topics column.
Notice we can create new tags from here as well.
We'll just click OK, and when we go to another topic here in our TOC you can see
the shading is applied to that topic.
And in fact, we can do the exact same thing for an entire TOC book. Maybe
Managing Your Training doesn't need to be included in our condensed version.
We can right-click the heading, go down to Apply Conditional Build Tag.
If we choose Condensed, it's only going to apply to the TOC, so let's do that.
And if we look at it, just by deselecting it, it looks like it's been excluded as
our condensed version.
There is a little tag that appears over the book.
But let's go back there, right-click, and go down to Apply Conditional Build Tag
and this time choose New/Multiple.
You can see it's only being excluded from the TOC. If you want to exclude the
topics as well, click that check box and click OK.
So all we've been doing now is applying the tags, but we need a build
expression that's going to say exclude those pieces from our condensed version
when we generate it.
So how do we do that?
Well, the first thing we can do is build the expression during a preview.
Here we are looking at the Searching topic.
If we do a Ctrl+W to preview that, we're going to see both paragraphs.
That's the default, and at the very top you can see, where it says Conditional
Build Tag Expression, None is being applied.
And if we click the dropdown, there's nothing else to choose from. We haven't
actually defined any expressions yet, but there is a Define button that we
can click right here.
So we could do it from the preview.
We could also do it outside of the preview.
I'll show you that momentarily.
Right now, we can choose from available tags, select them, and then click the
arrow to move them over to the Exclude from output list.
So when we click OK, look at the difference.
We now have the Condensed tag applied, and you can see it's not included.
So we can close up our preview.
And let's go down to our Single Source Layouts now and apply that build
expression to a project we're about to generate. Maybe it's for printed
documentation or similar to printed documentation.
We want a condensed version, so let's just create a duplicate as opposed to
changing our printed documentation layout.
We'll right-click Printed, we'll go up to Duplicate Layout, change the name
of Copy of Printed Documentation to Condensed Documentation, and then we'll click OK.
The Output Type is going to be Printed, so we'll OK, and now we have a new layout
here that we can apply.
So if we double-click this to generate our output, we may have to save
changes that we've made to our Searching topic, just click Yes to do that,
and then we'll see our Printed Document Condensed Documentation layout. And we
have a number of options, including--there it is, near the middle--Conditional Build Expression.
So we could define our expressions from here, like choosing not to display
anything tagged with the condensed build tag, but it's already there.
If we click the dropdown, it isn't just None, we have NOT Condensed here as well,
so we can select that, and then we can click Save and Generate.
Now I'll just take a moment to go through all of the topics. It's going to
look for those tags.
It's going to be excluding anything tagged as condensed, so an entire TOC book, a
topic, and portions of our searching content.
Eventually, we'll have an opportunity to view the results.
Viewing those results, we should see Managing Your Training is missing, we should
see Reactivating your Account is missing from the TOC, and when we go to the
Searching FAQs topics, we should be missing the second paragraph.
So let's click View Result.
It's going to generate a PDF here.
We can see the name, Condensed Documentation, the default title based on the
layout we just created. And as we scroll down into the Table of Contents, sure
enough, we're missing a topic and when we get down to Managing Your Account, we're
missing a topic here as well.
When we click Searching, you'll notice there is only one paragraph; we're missing
the second paragraph.
So we've created a version of our project that we have generated here called
Condensed basically using conditional build tags.
So just keep in mind, you can pick and choose any type of conditional build tag
you want. Simply apply it to the content and define your expression. That will
allow you to create different versions of your project to be generated without allow you to create different versions of your project to be generated without