Skip to main content
Inspiring
July 14, 2010
Question

Publishing and Date Last Updated

  • July 14, 2010
  • 1 reply
  • 1366 views

We're using RoboHelp 8.02 using the WebHelp SSL. There have been several discussions on how to effectively incorporate a "date last updated" in RoboHelp. I thought I'd found a strategy that worked, but now, publishing seems to have some random behavior that's throwing a kink into the strategy. Help me understand if my understanding of what "publish" does in RoboHelp is correct and what I may be doing wrong. My strategy is:

  1. I add a JavaScript script at the bottom of each page that pulls in, formats, and displays the file's Date Modified attribute.
  2. I generate the project locally.
  3. I publish the project to the server. (We're in a LAN environment where I can publish directly to the Web server.) The Publish settings are:
    • Check for deleted files: Selected
    • Prompt before overwriting files: Unselected
    • Republish all: Unselected

It has been my understanding that, with Republish all turned off, RoboHelp would only move files that had been changed to the server when publishing. In that way, the old files on the server (and hence displayed to the reader)  would continue to show the an older date, and the newly published files would show the newer date.

However, when we recently published one project, it appears that RoboHelp randomly moved some files that had not been modified to the server. Interestingly, it wasn't all the unmodified files, just some of them, and a random selection at that. Am I missing something, or is the behavior a bug?

For those who might be interested, the JavaScript that I use is:

<script type="text/JavaScript"
  language="JavaScript"><!--
//
// format date as dd-mmm-yy
// example: 12-Jan-99
//
function date_ddmmmyy(date)
{
  var d = date.getDate();
  var m = date.getMonth() + 1;
  var y = date.getYear();

  // handle different year values
  // returned by IE and NS in
  // the year 2000.
  if(y >= 2000)
  {
    y -= 2000;
  }
  if(y >= 100)
  {
    y -= 100;
  }

  // could use splitString() here
  // but the following method is
  // more compatible
  var mmm =
    ( 1==m)?'Jan':( 2==m)?'Feb':(3==m)?'Mar':
    ( 4==m)?'Apr':( 5==m)?'May':(6==m)?'Jun':
    ( 7==m)?'Jul':( 8==m)?'Aug':(9==m)?'Sep':
    (10==m)?'Oct':(11==m)?'Nov':'Dec';

  return "" +
    (d<10?"0"+d:d) + "-" +
    mmm + "-" +
    (y<10?"0"+y:y);
}


//
// get last modified date of the
// current document.
//
function date_lastmodified()
{
  var lmd = document.lastModified;
  var s   = "Unknown";
  var d1;

  // check if we have a valid date
  // before proceeding
  if(0 != (d1=Date.parse(lmd)))
  {
    s = "" + date_ddmmmyy(new Date(d1));
  }

  return s;
}

//
// finally display the last modified date
// as DD-MMM-YY
//
document.write(
  "This page was last updated on " +
  date_lastmodified() );

// --></script>

This topic has been closed for replies.

1 reply

Inspiring
July 23, 2010

In my template that is applied to each topic, I have a header and a footer. The footer contains copyright info and links to our support page and this code:

<p class=footertext><span style="font-size: x-small; font-style: italic; x-condition: Not_Print;">Last
modified: <variable name=date x-format=default x-constant=TRUE x-value=40381.572928>July 23, 2010</variable></span>

That updates the date on the topic when the help is generated. For example:

http://help.globalscape.com/help/eft6-2/index.htm#Introduction_to_EFTServer.htm

Much less complicated that all of that JS!

LarryTXAuthor
Inspiring
July 26, 2010

I wasn't aware of the "variable" tag. Is it something that's built into RoboHelp? How does the x-value get entered? It looks like a serial date; if one has to enter that manually, then it would be just as easy to manually enter the date. Ditto for "July 23, 2010." Is it automatically produced by the code?

Inspiring
July 26, 2010

Yes, I have the code in the template and when I generate and publish WebHelp, the date is updated.