Skip to main content
February 11, 2008
Question

Conditional Text Question

  • February 11, 2008
  • 8 replies
  • 1167 views
Hi,
Is it possible to make a style within the CSS conditional? Rather than mark lines of text as conditional (not for print), I'm wondering whether I can simply apply a style to them and indicate only one time that the style itself should not print.
I'm outputting webhelp from RH7.
Thanks.
    This topic has been closed for replies.

    8 replies

    MergeThis
    Inspiring
    February 12, 2008
    First, RH doesn't always interpret the @media function properly.

    Second, I think you're doing yourself a disservice by ignoring the use of conditionals in a situation that is tailor-made for them. Once you have set the proper conditionals in your WebHelp SSLayout and in your PrintDoc SSLayout, there's no "likelihood of forgetting the conditional tag," is there?

    If there's anything I've learned over the years using HATs, it's these things:

    1. What's the simplest to maintain...tomorrow...next week...next month...as the project grows and grows?
    2. How does this HAT handle this (HTML, CSS, JavaScript, etc.) feature?
    3. Just because you can, doesn't mean you should.

    Good luck,
    Leon
    February 12, 2008
    Thanks to everyone for the feedback. I will be using conditional tags...I certainly understand the value they offer and didn't mean to imply otherwise. Just trying to do my due dilgence.
    Peter Grainge
    Community Expert
    Community Expert
    February 12, 2008
    Out of curiosity I tried the idea of specifying two style sheets. RH will only work with the style sheet that is specified in Topic Properties. It ignores any other references added in code/html view.

    Use the menu (bottom right) to mark the Best Answer or Highlight particularly useful replies. Found the answer elsewhere? Share it here.
    Peter Grainge
    Community Expert
    Community Expert
    February 11, 2008
    I wasn't suggesting it would. I was simply advising ConTextCB about using the hidden style I had suggested earlier. Nothing whatever to do with your reply.

    Use the menu (bottom right) to mark the Best Answer or Highlight particularly useful replies. Found the answer elsewhere? Share it here.
    Peter Grainge
    Community Expert
    Community Expert
    February 11, 2008
    I think this has been overtaken by Rick's suggestion but the method I suggested will apply to all outputs so it is of no use if you want it to appear in your webhelp. Otherwise you would just add visibility: hidden to the style definition.

    Use the menu (bottom right) to mark the Best Answer or Highlight particularly useful replies. Found the answer elsewhere? Share it here.
    RoboWizard
    Inspiring
    February 11, 2008
    Hi Peter

    Hmmm, I wouldn't think my suggestion would have changed anything with respect to what prints or what you were talking about with respect to hiding things during print. I was only offering a way to simplify the page. What I suggested would only apply to what appears totally behind the scenes, not the visible part. For example, yes we eliminate one bookmark, but nobody sees that. The link still remains.

    So everything you were discussing before still applies.

    Cheers all... Rick
    Peter Grainge
    Community Expert
    Community Expert
    February 11, 2008
    So this style will never appear in any output?

    If that is the case try

    P.HiddenBookmark {visibility: hidden;}

    You don't have to call it HiddenBookmark. Change that to whatever you want.

    That will allow you to see it in WYSIWYG but not in any output, online or printed.

    Use the menu (bottom right) to mark the Best Answer or Highlight particularly useful replies. Found the answer elsewhere? Share it here.
    February 11, 2008
    Hi Peter,
    I do want the 'top' tag to appear in the Webhelp output, just not the PDF output. So, for my edification, can you explain a bit more about the P.HiddenBookmark/ Where do I add that and where do I specify the hidden parameter?
    Thanks again.
    February 11, 2008
    Thanks to both Peter and Pete, or should I say Repete?
    I plan to use a link labeled 'top' that goes to a bookmark at the very start of the page. This will appear only in long topics. I don't want the 'top' link to appear in the PDF output. I completely understand that styling the link will probably take as much time as marking it conditional; however, I am hoping to minimize the likelihood of forgetting the conditional tag. Because 'top' is already a style, I'd like to knock it off in one step.
    I'll take a look at the code.
    Thanks again.
    RoboWizard
    Inspiring
    February 11, 2008
    Hi ConTextCB

    As far as your bookmark goes, perhaps you may also consider changing your approach. You can easily simplify this by omitting the actual bookmark. For example, if it's named 'Top'. Then where your links formerly pointed to #Top, amend them to simply point at #. The end result should be a cleaner behavior, less code and less to keep in mind as there is no need to create the bookmark. Pointing to # simply causes the page to reload and display from the beginning.

    Just a thought... Rick
    February 11, 2008
    Rick,
    Thanks for the tip. I've been using RH for several years and never knew about the #! How humbling. Great tip.
    Thanks.
    Participating Frequently
    February 11, 2008
    ConTextCB,

    It sounds like you want to use a media-specific style, as in the example below. Anything that is tagged with the style ScreenOnly is visible onscreen but hidden when printed.

    More information here:

    http://meyerweb.com/eric/articles/webrev/200001.html

    Pete
    Peter Grainge
    Community Expert
    Community Expert
    February 11, 2008
    No way that I am aware of.

    You can specify a style that appears in the editor but not in any output. However, I believe you want the content to only be hidden in the printed output.

    I am not clear though as to how that would be an advantage. One way you apply a tag, the other way you apply a style. Either way requires much the same amount of work.

    What you could do is apply a CSS style called 'noprint'. When you generate your Word document map to a style in your template called 'noprint' and then use Word to find all paragraphs with that style and delete them.

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