Skip to main content
Inspiring
November 5, 2024
Answered

Variables don't use applied style in RH2022

  • November 5, 2024
  • 7 replies
  • 876 views

I'm using RH2022.5.28.  We're looking at implementing variables.  But when I add a variable to a heading it doesn't display using the heading style.  The heading is bold and uses a larger font size.  It displays as bold but not in the larger font size. 

    This topic has been closed for replies.
    Correct answer Nikki232229032y98

    My colleague has just tried it and looked into it further, as it was happening on her projects too.  She's found what was causing it.  The css file has a style called <span>, possibly inserted when we were using Robohelp Classic years ago.  Deleting that style has made it work. 

    Thank you for your help.

    7 replies

    Peter Grainge
    Community Expert
    Community Expert
    November 7, 2024

    OK. As I said, there had to be something else at play. Glad you have sorted it out.

    ________________________________________________________

    My site www.grainge.org includes many free Authoring and RoboHelp resources that may be of help.

     

    Use menu (bottom right) to mark as Best Answer or to Highlight particularly useful replies. Found the answer elsewhere? Share it here.
    Peter Grainge
    Community Expert
    Community Expert
    November 7, 2024

    There is something else at play here as that is definitely how it should work. I have not seen anyone else report this.

     

    If you create a new single topic project, does it work there as I have described?

     

    Can you share your problem project? If you can, then see the Contact page on my site and send the project as instructed there. Do make sure you include a link to this thread and please do not email the project direct.

    ________________________________________________________

    My site www.grainge.org includes many free Authoring and RoboHelp resources that may be of help.

     

    Use menu (bottom right) to mark as Best Answer or to Highlight particularly useful replies. Found the answer elsewhere? Share it here.
    Nikki232229032y98AuthorCorrect answer
    Inspiring
    November 7, 2024

    My colleague has just tried it and looked into it further, as it was happening on her projects too.  She's found what was causing it.  The css file has a style called <span>, possibly inserted when we were using Robohelp Classic years ago.  Deleting that style has made it work. 

    Thank you for your help.

    Peter Grainge
    Community Expert
    Community Expert
    November 7, 2024

    Here's video to show how it is done. After inserting the snippet I have changed to Preview so that you can see it works.

     

    https://www.grainge.org/demos/variables/variables.mp4

    ________________________________________________________

    My site www.grainge.org includes many free Authoring and RoboHelp resources that may be of help.

     

     

    Use menu (bottom right) to mark as Best Answer or to Highlight particularly useful replies. Found the answer elsewhere? Share it here.
    Inspiring
    November 7, 2024

    Unfortunately that isn't what is happening for me at all.  It does exactly what I've shown in my screenshots.

    Peter Grainge
    Community Expert
    Community Expert
    November 7, 2024

    Create a new topic just for the purposes of getting the hang of it.

     

    The first line should be the default title of the topic and it should be H1 style. Change the text of the heading if you want.

     

    Now drag the variable in front of the text. What you should see is the variable in the heading style and then the text.

    ________________________________________________________

    My site www.grainge.org includes many free Authoring and RoboHelp resources that may be of help.

     

    Use menu (bottom right) to mark as Best Answer or to Highlight particularly useful replies. Found the answer elsewhere? Share it here.
    Peter Grainge
    Community Expert
    Community Expert
    November 7, 2024

    Your code is wrong. 

     

    Adding a variable to a heading my code is like this.

     

    <h1>Second Topic <span data-keyref="Variable 1">Variable 1</span></h1>

     

    Your closing span tag is in the wrong place. If you drag the variable to the heading, it should write it as above.

     

    Please use the photo icon to insert images within the post. Seeing an image inline with the text makes it easier for anyone answering or viewing the post.

    ________________________________________________________

    My site www.grainge.org includes many free Authoring and RoboHelp resources that may be of help.

     

    Use menu (bottom right) to mark as Best Answer or to Highlight particularly useful replies. Found the answer elsewhere? Share it here.
    Inspiring
    November 7, 2024

    I don't understand, sorry.  I don't want the variable text at the end of the sentence though, it needs to be at the beginning with text after it, so the span can't be at the end.  And I didn't write the code, that was put in by RH when I inserted the variable.  I didn't add any code to the variable itself.  I'm confused.

     

    Inspiring
    November 7, 2024

    Even if I put it at the end it still doesn't display properly.  Am I misunderstanding this? 

    The only way I can get it to work is if I create another variable with the styles applied in the variable itself.  So I need a different variable for each heading style it could be used in. 

     

    Community Expert
    November 7, 2024

    You shouldn't need to create a separate variable. It should take the formatting of the paragraph it is placed in.

     

    If yuo have applied manual formatting to the variable, of course, then you would need a separate variable, but in most cases this shouldn't be necessary.

    Inspiring
    November 7, 2024

    No. It doesn't seem to work like that.  If I insert variable text into a heading, it doesn't use the heading style.  I have to create another variable for each heading style.  As described in the link I was provided.

    Jeff_Coatsworth
    Community Expert
    Community Expert
    November 5, 2024
    Inspiring
    November 5, 2024

    No I hadn't.  I can see from that I need to create a separate variable for use in the heading.  That's useful.  Thanks