Tip:
Highlight text to annotate it
X
If you know there are certain content that you're going to be using more
than once in a project, you might consider using something called a user-defined variable.
Imagine, for example, you wanted to add copyright information to the bottom
of every topic. You could create that once and then copy and paste it
throughout your topics.
If you need to make a change to that content, however, you'll have to make
changes everywhere you pasted it.
So a better option is to use that user-defined variable we're going to talk
about right now, as we continue working with our using LDC tags project.
Let's just expand our Getting Started TOC book and then double-click Welcome.
We'll start there, right at the very first topic.
And as we scroll down towards the bottom, let's create a little extra space by
clicking at the end of How To Use lynda.com and hit Enter a couple of times.
This would be a great place to add that copyright information.
We could start typing, but instead, let's use a user- defined variable.
So to do that, we need to access the pod, which appears in a tab down across the
bottom, User Defined Variables. Give it a click.
If you don't see it there, you're probably not using the default view,
and you'll have to go to the View menu and down to pods, where you'll find this option.
By default, there aren't any, so we have to create our own user-defined
variables by clicking this little button here--it looks at a couple of cogs--for
creating a new one And when we click it, you'll see there are two fields:
one where we give it a name, the other where we actually enter the content.
So the Variable Name, let's just call it Copyright. In the Variable value field
we'll enter some text. How about Copyright 1995 to 2011 lynda.com? There it is.
All rights reserved. And maybe this should be 2010 not 2011, so I'll change
that. Click OK and we have our first variable.
So it's sitting there in our pod.
We see a preview of what it is going to look like over here on the right-hand side.
And now there is a couple of different ways to get it into our content.
First of all, we can click where we want it--there we go, right at the bottom of
our topic for Welcome. And then just click and drag from the pod itself into
our topic, and you see the little red cursor is going to show us exactly where
we're about to place it.
So right about there, leaving a one blank line. Let go and it's entered.
Now this is a variable, so if we tried to come in here and maybe change that,
notice when we click anywhere inside that content, the entire piece is
highlighted or selected.
So if we want to make changes, we actually make changes to the variable
itself, and we'll see those changes wherever we've added it to our project, so let's do that.
Let's double-click Memberships.
We'll do the same thing.
We'll scroll down to the end after our graphic and hit Enter a couple of times
just to create some space.
Another way to insert, if you're not viewing the user- defined variables pod, is
to go to the Insert menu. You'll see it there, towards the bottom, User Defined
Variable. It opens up a different window where you'll see any and all, in this case
just our one copyright variable. With it selected, we click Insert, and in
the background, we just inserted it.
And this stays open, so we can go to other topics if we wanted to, or close it up.
We will add one more.
Let's go to exercise files. Same thing. Scroll to the bottom, click, Enter a
couple of times, and we'll just drag it in this time, and let go.
Now we realize it really should be Copyright 1995 to 2011.
Well, all we have to do now is just double-click our copyright variable here in
the pod itself to open up the User defined Variable Properties. There is the name,
we'll keep it at the same, and there's the content. And we'll make the change
here from 2010 to 2011, take out the 0, add the 1. And when we click OK, you can
see what's happened.
It's changed right here at the bottom in our topic, and as we go to the Welcome
topic, it's fixed there as well. Same thing under Memberships.
So we entered it once, made the change once, and we see those changes in
multiple topics. That's because we're using a variable.
And we save up all our changes and we go down to our variable in the pod and double-click,
you'll actually see all of the topics where that variable is used.
You can see them all listed here.
We'll click Cancel to close that up, and you can decide now when and where you might want to use a user-defined variable.