Variable Text for topics "Not Complete"

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

Post Reply
User avatar
Bob MacLeod
Posts: 16
Joined: Thu Dec 14, 2006 9:53 pm

Variable Text for topics "Not Complete"

Unread post by Bob MacLeod » Fri Jun 19, 2020 11:51 am

We are in a major software development program for a new tool and I have been building the manual as we go, often starting topics by simply copying email messages from the team and creating placeholder topics with plans for future cleaning up. As a result, the help manual has 171 topics, 67 of which are marked "Complete".

Because I want developers and testers to have access to even the incomplete topics, I have added a "Topic Status: <%TOPICSTATUS%>" text at the very top of each topic, so the reader immediately knows if he is reading a topic deemed complete (and should be very accurate) vs. any other status to be read with an eye for improvement.

The challenge I face is that when the TOPICSTATUS is "Complete", the variable returns a blank.

I am asking two alternatives or another idea:
  • Is it possible to use an IF/THEN (not sure what that trigger is called) where the entire line would be visible or hidden depending on whether the status is complete or not? By doing that, only non-complete topics would contain the text "Topic Status:" and completed topics would show nothing?
  • Or is it possible to use a variable that would include the topic status of "Complete"?

User avatar
Tim Green
Site Admin
Posts: 21690
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Variable Text for topics "Not Complete"

Unread post by Tim Green » Sat Jun 20, 2020 7:06 am

Hi Bob,

That variable should definitely return a value for Complete as well. I'm adding this to the ToDo list for our developers. :)
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.

Simon_Dismore
Posts: 171
Joined: Thu Jul 13, 2017 2:57 pm

Re: Variable Text for topics "Not Complete"

Unread post by Simon_Dismore » Sat Jun 20, 2020 7:46 am

Tim Green wrote:
Sat Jun 20, 2020 7:06 am
That variable should definitely return a value for Complete as well. I'm adding this to the ToDo list for our developers. :)
That could be a breaking change, Tim. It would be better to add a new status (e.g. 'Final', 'Finished' etc) and leave the behaviour of 'Complete' unchanged.

Simon_Dismore
Posts: 171
Joined: Thu Jul 13, 2017 2:57 pm

Re: Variable Text for topics "Not Complete"

Unread post by Simon_Dismore » Sat Jun 20, 2020 8:01 am

Bob MacLeod wrote:
Fri Jun 19, 2020 11:51 am
  • Is it possible to use an IF/THEN (not sure what that trigger is called) where the entire line would be visible or hidden depending on whether the status is complete or not? By doing that, only non-complete topics would contain the text "Topic Status:" and completed topics would show nothing?
If you are publishing the drafts to an HTML format (WebHelp, eWriter, CHM) there's a hack to do this:
  • Don't put "Topic status:" in front of <%TOPICSTATUS%>
  • Instead, create a new style (i.e. with a unique name) and apply that directly to <%TOPICSTATUS%>
  • Use CSS to define that style (specifically the f_stylename variant published by H+M) as having "Topic status: " (or similar) as its ::before content
This works because if the variable is empty it doesn't get output, so the style isn't applied. Here's a snippet that uses this approach: myStatusStyle is defined as Normal+red in H+M's snippet repository, f_myStatusStyle is generated by H+M when publishing to HTML, so that's what we extend using CSS:

Code: Select all

<topic template="Default" lasteditedby="SimonDismore">
  <title translate="true">myStatus</title>
  <body>
    <header>
      <para styleclass="Heading1"><text styleclass="Heading1" translate="true">myStatus</text></para>
    </header>
    <para styleclass="Normal"><html-code width="100" height="16" inline="true"><![CDATA[<style>.f_myStatusStyle::before
{content: "Note: this topic is ";}
</style>
]]></html-code><var styleclass="myStatusStyle">&lt;%TOPICSTATUS%&gt;</var></para>
  </body>
</topic>
When the topic status is 'Complete', nothing is output, because H+M doesn't style the empty <%TOPICSTATUS%> variable. If there's another status (e.g. 'Under Construction') the variable is rendered by prepending the ::before content to the variable value, and formatting the result as it is styled in H+M (e.g. "Note: this topic is Under Construction").

For more about ::before etc, see this CSS Tricks article.

Post Reply