I was asked recently how to figure out where the end of a particular set of tags was so a <p> tag could be inserted. This comes up when you’re working among nested divs, ordered/unordered lists, etc.

Here’s an example of  such a scenario:

The situation here is that you have two container divs nested inside other container divs inside yet other container divs. AND you have unordered lists. The scenario is that you want to add a <p> tag here:

If you just hit Enter right where the cursor is (in the last <li> tag of the first ordered list, you will simply create another <li> tag.

So, how do you get a) outside of the <ul> and b) outside of a bunch of divs so your <p> tag is sitting outside of all structural tags except the body? Luckily, the solution is easy…and quite visible.  Here we go…

First, I’m going to click on the first <li> tag in the list (shown in blue in the screenshot below) so you can see things more clearly. This will allow give me an opportunity to show you a few tips and tricks along the way.

Now you’re going to use your directional keys on your keyboard. Click the down arrow twice and watch what happens…the shaded blue area moves to the second <li> tag in the list. This means that you are inside of that particular tag.

If you were to start typing now, you would be adding text to that <li> tag.  Not exactly what we’re wanting to do…but something good to know.

Now, click the down arrow again.

You are now inside the <ul> tag. If you were to begin typing, a bullet would appear and then your text. In this instance, I have a custom <li> class because of the diamonds but only the basic <li> styled bullet will appear (as shown circled below). I’d have to set the class of the <li> tag to get the diamond to show.

Again, while good to know, this doesn’t get us where we need to be, which is outside of the <ul> tag and outside of all the <div> tags. So we move on. Keep clicking the down arrow and watch the blue area shift.  Stop when you get past the last <li> tag, the last <ul> tag, and the innermost <div> tag is highlighted blue, like below:

So, now we’re out of the <ul> tag, but still in that <div> tag. If you were to start typing, you’d see your text entered inside of a <p> tag inside of the <tag>.

The result is text that would remain within the boundaries of the container <div> but outside of the unordered list. We’re getting closer, but we’re not quite there.

Click the down arrow until you land in the outermost (furthest to the left) <div> tag, as shown below:

.

You’re there! Now, you can enter text and it will be inside a <p> tag and yet outside of the confines of the <div> tag. See results below:

This is a great way to find where you need to be in a series of nested <div> tags or complex lists. Try it and let me know what you think.

I recently taught a class on Flare and something came up that was new to me…adding a variable to a TOC entry. Thank you to Becky R for providing me with this topic!

I knew there was a way to do it but I’d never known how when the variable is surrounded by other text. Let’s start from the beginning, though. Adding a variable without additional text to a TOC entry.

For example, let’s say you have a variable for the name of your product called ACME. To enter that variable in to a TOC entry, simply open the TOC in the Project Organizer, add a new entry (or edit an existing one), and add the following text:

To do this successfully, you must know the exact name of the variable set, even if its a default set or MyVariables.  Then you need to know the exact variable name.

Replace VariableSet in the screenshot with the real variable set name, and replace VariableName with the real name.

What does this accomplish? It inserts the variable in to the TOC entry…and that’s it. Here’s what it will look like (so you don’t think it’s broken…because it LOOKS broken)…

 

You have to do a build before you’ll see how it looks.

Looks great…except that when would you actually just use the Product Name in a TOC entry? I would be more likely to use a TOC entry titled, ‘Installing ACME’ or ‘Using ACME.’

Problem is…..the method I just described only works when that variable is the only text in the entry. So the two examples immediately above would not work. BUT, there’s an answer for this:

To make the ‘Installing ACME’ example work as a TOC entry, you would type:

Installing [%=MyVariables.ProductName%]

When you do a build, the new TOC entry looks like this:

Does this work? Clearly. Is it a pain? Yes. And I’m not sure why. MadCap has streamlined almost everything else…but this.

And here’s why it’s a pain. I had to take the second screenshot above three times because, the first time, I left off the ‘s’ from MyVariables, and the second time, I used a period instead of a colon. So the screenshot you see is a third attempt. Frustrating!

And the last screenshot above – that’s the second take. The first time, I left out the ‘=’ and got an error on build.

So, while it works, I don’t think it’s the smoothest feature in Flare…nor do I think it’s intuitive at all.

Have you had experience with this feature in Flare?

Page 10 of 26← First...8910111220...Last →

Recent Posts