How to apply style to variables?
-
- Propeller Head
- Posts: 16
- Joined: Tue Aug 06, 2013 6:28 am
How to apply style to variables?
Hi
I need to apply the style "Strong" to one of my variables. When I do this, the value of the variable is not displayed in bold, as would normally be the case when I apply the style Strong.
Can anyone help me out?
Cheers,
Anders
I need to apply the style "Strong" to one of my variables. When I do this, the value of the variable is not displayed in bold, as would normally be the case when I apply the style Strong.
Can anyone help me out?
Cheers,
Anders
-
- Senior Propellus Maximus
- Posts: 2634
- Joined: Wed Apr 14, 2010 8:01 am
- Location: Surrey, UK
Re: How to apply style to variables?
As far as I'm aware, THAT'S A BUG! I'm sure someone will be along shortly to show how to report bugs, and it would be good if lots of us do so it gets higher up the list of priorities for being fixed.
HOWEVER, in the meantime I can suggest a workaround. Pain in the rear end, but it can be done.
Insert the variable.
Highlight it, including its markers, and apply the span. You will probably find you get a new (empty) pair of markers beside the variable. This is the SPAN pair.
Highlight the variable and drag it inside the empty pair of markers.
You may need to adjust the spaces, so you don't end up with too many or too few.
Clunky and a bloomin' nuisance to do, but it should get you by.
HTH.
HOWEVER, in the meantime I can suggest a workaround. Pain in the rear end, but it can be done.
Insert the variable.
Highlight it, including its markers, and apply the span. You will probably find you get a new (empty) pair of markers beside the variable. This is the SPAN pair.
Highlight the variable and drag it inside the empty pair of markers.
You may need to adjust the spaces, so you don't end up with too many or too few.
Clunky and a bloomin' nuisance to do, but it should get you by.
HTH.
Started as a newbie with Flare 6.1, now using Flare 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Re: How to apply style to variables?
And if you always want that variable to be bold, then do what Choccie said, but do it in a snippet file. Then instead of inserting the variable in the topic, insert the snippet.
And you can report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
And you can report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
-
- Propeller Head
- Posts: 16
- Joined: Tue Aug 06, 2013 6:28 am
Re: How to apply style to variables?
Hi Lisa and ChoccieMuffin.
Thanks for your feedback. I have created a bug on this, and later I will try out the workaround - at least until this has been fixed.
And regarding the snippet suggestion, I will give it a go too. However, as in the near future I will be teaching my colleagues how to use Flare (they are not tech writers), I will try to keep things as simple as possible. Afraid this might "overwhelm" them
Thanks again,
Anders
Thanks for your feedback. I have created a bug on this, and later I will try out the workaround - at least until this has been fixed.
And regarding the snippet suggestion, I will give it a go too. However, as in the near future I will be teaching my colleagues how to use Flare (they are not tech writers), I will try to keep things as simple as possible. Afraid this might "overwhelm" them
Thanks again,
Anders
-
- Jr. Propeller Head
- Posts: 5
- Joined: Thu Dec 23, 2010 8:16 am
Re: How to apply style to variables?
Hi there,
Does anyone know if there's a fix for this?
It's a pain to use a snippet and not the best to apply the style each time we use the variable.
Thanks.
Does anyone know if there's a fix for this?
It's a pain to use a snippet and not the best to apply the style each time we use the variable.
Thanks.
Re: How to apply style to variables?
Yes, you can style variables, but it's an 'undocumented feature' that only works for the HTML5 output.
In HTML5 output, variables are enclosed in a span tag, and will have a class name based on the variable name.
For example, the variable Variables.CompanyName will appear in the output as:
(Note the class name is the file and tag name without the '.' )
So all you need to do is add a style for that in your stylesheet; e.g.
In HTML5 output, variables are enclosed in a span tag, and will have a class name based on the variable name.
For example, the variable Variables.CompanyName will appear in the output as:
Code: Select all
<span class="VariablesCompanyName">MadCap Software</span>
So all you need to do is add a style for that in your stylesheet; e.g.
Code: Select all
span.VariablesCompanyName
{
color: blue;
}
Re: How to apply style to variables?
You can also style variables for Word outputs using the MadCap|variable css classes.
Note: MadCap have confirmed that this is a bug, as these classes are only intended to style the variable in Flare's WYSIOP viewer and not in external outputs.
Code: Select all
MadCap|variable
{
font-weight: bold;
}
MadCap|variable.Normal
{
font-weight: normal;
}
"In an ideal world, software should be simple, well designed, and completely intuitive to end users. In the real world, good documentation is king."
Re: How to apply style to variables?
I should also note that I logged a feature request recently asking MadCap to add an extra field to the Variables grid, allowing users to map variables to a specific style in the style sheet.
"In an ideal world, software should be simple, well designed, and completely intuitive to end users. In the real world, good documentation is king."
Re: How to apply style to variables?
One of the other things you can do, playing off of Dave's method -- if you include spaces in the variable name, it will include each space-separated word as a class. For example, if the variable name was "ThisVariable Strong", when you generated the output you would see two classes applied to the variable, ThisVariable and Strong.
So, if you had a couple classes defined, like:
You could create a variable with the name, "thisvariable1 red strong", and the definition, "Example" -- in the final output, it would appear as: Example
I wouldn't advocate this as the BEST method, but it's another way.
So, if you had a couple classes defined, like:
Code: Select all
.red {
color: red;
}
.strong {
font-weight: strong;
}
I wouldn't advocate this as the BEST method, but it's another way.
-
- Senior Propellus Maximus
- Posts: 2634
- Joined: Wed Apr 14, 2010 8:01 am
- Location: Surrey, UK
Re: How to apply style to variables?
I have managed to apply styles to variables, but it's a faff.
- 1. In Flare, type the sentence, including the variable.
2. Place the cursor in front of the variable and type "x" (or something - anything!) then apply the span to the "x".
3. Highlight the variable and drag it inside the applied span.
4. Delete the "x".
5. Check that the variable has actually ended up inside the span. If not, repeat steps 1-4 while pulling out handfuls of hair.
Started as a newbie with Flare 6.1, now using Flare 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Re: How to apply style to variables?
Funnily enough, that's what MapCap Support advised me to do when I asked for a method of styling variables!ChoccieMuffin wrote:I have managed to apply styles to variables, but it's a faff....
"In an ideal world, software should be simple, well designed, and completely intuitive to end users. In the real world, good documentation is king."
-
- Senior Propellus Maximus
- Posts: 2634
- Joined: Wed Apr 14, 2010 8:01 am
- Location: Surrey, UK
Re: How to apply style to variables?
It does actually make sense that you should have to manually style variables in the topics where they're used, as there's no guarantee that you always want your variables to use the same styling whatever the output. But I wish I could JUST highlight the variable in the topic and apply a span without having to mess around quite so much. Ho hum, feel free to raise a feature request (or is it a bug?)
Started as a newbie with Flare 6.1, now using Flare 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx