Insert ate in webhelp output
-
- Posts: 84
- Joined: Sun May 03, 2015 7:34 pm
- Location: San Francisco
Insert ate in webhelp output
Hi,
Is there a variable to capture the date that a file was last edited to show it in output? I guess the published date would also be ok.
Thanks,
-Nicholas
Is there a variable to capture the date that a file was last edited to show it in output? I guess the published date would also be ok.
Thanks,
-Nicholas
Re: Insert ate in webhelp output
Hello,
The WebHelp Responsive System provides various placeholders where you can include custom content in the output via transformation parameters.
You cand find the complete list of predefined placeholders here:
https://www.oxygenxml.com/doc/ug-editor ... ation.html
For example, if you want to add the publishing date in the footer of your HTML pages, you will have to edit the transformation scenario and set the webhelp.fragment.footer parameter to ${date(yyyy-MM-dd)}.
Regards,
Alin
The WebHelp Responsive System provides various placeholders where you can include custom content in the output via transformation parameters.
You cand find the complete list of predefined placeholders here:
https://www.oxygenxml.com/doc/ug-editor ... ation.html
For example, if you want to add the publishing date in the footer of your HTML pages, you will have to edit the transformation scenario and set the webhelp.fragment.footer parameter to ${date(yyyy-MM-dd)}.
Regards,
Alin
Alin Balasa
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 137
- Joined: Sat Feb 26, 2005 12:09 am
- Location: USA
- Contact:
Re: Insert ate in webhelp output
I have the same need to insert the publication date. I tried setting
But it does not evaluate it as a variable? How are you supposed to insert the current date?
I have also tried using:
but cannot find the proper place to override the default footer to insert this.
Code: Select all
<param name="webhelp.fragment.footer"
desc="Specifies the path to the HTML file that contains the content for the WebHelp footer. It can also be an XML fragment."
type="file">
<val default="true">${date(yyyy-MM-dd)}
</val>
</param>
I have also tried using:
Code: Select all
<xsl:value-of select="format-date(current-date(), '[D01] [MNn,3-3] [Y0001]')"/>
Scott Hudson
Content Strategist
Jeppesen
Site: jeppesen.com
Content Strategist
Jeppesen
Site: jeppesen.com
-
- Posts: 137
- Joined: Sat Feb 26, 2005 12:09 am
- Location: USA
- Contact:
Re: Insert ate in webhelp output
btw, this is using the webhelp-responsive plugin on oxygen 18.
Scott Hudson
Content Strategist
Jeppesen
Site: jeppesen.com
Content Strategist
Jeppesen
Site: jeppesen.com
-
- Posts: 137
- Joined: Sat Feb 26, 2005 12:09 am
- Location: USA
- Contact:
Re: Insert ate in webhelp output
nvrmind. setting the transform scenario as described works!
Scott Hudson
Content Strategist
Jeppesen
Site: jeppesen.com
Content Strategist
Jeppesen
Site: jeppesen.com
-
- Posts: 84
- Joined: Sun May 03, 2015 7:34 pm
- Location: San Francisco
Re: Insert ate in webhelp output
Hi Alin,
Sorry for the late reply. So, we can add the current date no problem. The issue is how to capture the date that a file was modified. Thoughts? We'd like each HTML page to have the date a file was modified so that engineers know how out-of-date the content is. If it's just the published date, then all files look equally up-to-date.
Thanks!
-Nicholas
Sorry for the late reply. So, we can add the current date no problem. The issue is how to capture the date that a file was modified. Thoughts? We'd like each HTML page to have the date a file was modified so that engineers know how out-of-date the content is. If it's just the published date, then all files look equally up-to-date.
Thanks!
-Nicholas
Re: Insert ate in webhelp output
Hello,
There might be a solution for your use case but you should store your DITA project on a SVN repository.
You will have to declare a custom meta data property in each topic file with the value set to "$Date$". For example:
The version control system will replace the $Date$ keyword with the last time the file was known to have been changed in the repository. For example:
To enable the version control system to process the $Date$ keyword in a file, you should set the svn:keywords property to "Date" for that file.
You can read more about SVN keywords here: http://svnbook.red-bean.com/en/1.7/svn. ... words.html
The custom meta data property will be transferred in the output HTML file as follows:
You can now contribute a custom JavaScript code that reads the information from the meta element and inserts it in the footer section.
You can use the following JavaScript snippet as a starting point:
The procedure can be found here: https://www.oxygenxml.com/doc/versions/ ... -html.html
You can use the XML Refactoring Tool to insert the metadata content into your DITA topics (see the Insert XML Fragment operation).
Regards,
Alin
There might be a solution for your use case but you should store your DITA project on a SVN repository.
You will have to declare a custom meta data property in each topic file with the value set to "$Date$". For example:
Code: Select all
<topic id="topic1">
<title>Topic 1</title>
<prolog>
<metadata>
<othermeta name="last-changed" content="$Date$"/>
</metadata>
</prolog>
<body>
<p></p>
</body>
</topic>
Code: Select all
$Date: 2006-07-22 21:42:37 -0700 (Sat, 22 Jul 2006) $
You can read more about SVN keywords here: http://svnbook.red-bean.com/en/1.7/svn. ... words.html
The custom meta data property will be transferred in the output HTML file as follows:
Code: Select all
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en-us">
<head>
............................................................
<meta name="last-changed" content="$Date: 2017-03-14 15:02:16 +0200 (Tue, 14 Mar 2017) $" />
.......................
</head>
..............................................................
</html>
You can use the following JavaScript snippet as a starting point:
Code: Select all
var date = $('meta[name=last-changed]').attr('content');
$('.footer-container').text(date);
You can use the XML Refactoring Tool to insert the metadata content into your DITA topics (see the Insert XML Fragment operation).
Regards,
Alin
Alin Balasa
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com