Insert ate in webhelp output
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 86
- Joined: Sun May 03, 2015 7:34 pm
- Location: San Francisco
Insert ate in webhelp output
Post by urbanrobots »
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
-
- Site Admin
- Posts: 275
- Joined: Thu Dec 24, 2009 11:21 am
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: 156
- Joined: Sat Feb 26, 2005 12:09 am
- Location: USA
- Contact:
Re: Insert ate in webhelp output
Post by shudson310 »
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
Staff Content Engineer
Site: docs.servicenow.com
Staff Content Engineer
Site: docs.servicenow.com
-
- Posts: 156
- Joined: Sat Feb 26, 2005 12:09 am
- Location: USA
- Contact:
Re: Insert ate in webhelp output
Post by shudson310 »
btw, this is using the webhelp-responsive plugin on oxygen 18.
Scott Hudson
Staff Content Engineer
Site: docs.servicenow.com
Staff Content Engineer
Site: docs.servicenow.com
-
- Posts: 156
- Joined: Sat Feb 26, 2005 12:09 am
- Location: USA
- Contact:
Re: Insert ate in webhelp output
Post by shudson310 »
nvrmind. setting the transform scenario as described works!
Scott Hudson
Staff Content Engineer
Site: docs.servicenow.com
Staff Content Engineer
Site: docs.servicenow.com
-
- Posts: 86
- Joined: Sun May 03, 2015 7:34 pm
- Location: San Francisco
Re: Insert ate in webhelp output
Post by urbanrobots »
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
-
- Site Admin
- Posts: 275
- Joined: Thu Dec 24, 2009 11:21 am
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
-
- Posts: 158
- Joined: Fri Nov 10, 2017 8:16 am
Re: Insert ate in webhelp output
Hi,
Is there any way to insert the Oxygen default variable ${date(yyyy-MM-dd)} in my customized html fragment?
I need to insert a date&time in each topic page, after I generate the webhelp, this date& time should be displayed on all the topic pages.
Can I use the variable ${date(yyyy-MM-dd)} ?
If yes, how to insert the variable in my html fragment?
If not, should I need to add a customized variable, and insert to my html fragment, and how?
Thanks!
Is there any way to insert the Oxygen default variable ${date(yyyy-MM-dd)} in my customized html fragment?
I need to insert a date&time in each topic page, after I generate the webhelp, this date& time should be displayed on all the topic pages.
Can I use the variable ${date(yyyy-MM-dd)} ?
If yes, how to insert the variable in my html fragment?
If not, should I need to add a customized variable, and insert to my html fragment, and how?
Thanks!
-
- Posts: 404
- Joined: Thu Aug 21, 2003 11:36 am
- Location: Craiova
- Contact:
Re: Insert ate in webhelp output
Post by radu_pisoi »
Hi,
Oxygen editor variables, like ${date(yyyy-MM-dd)}, are not available in WebHelp HTML fragments.
Instead, you can use one of the available webhelp macros. For the current case, you can use the $timestamp macro:
You can find a sample publishing template that appends the current date in the output footer using the $timestamp macro here:
https://github.com/oxygenxml/oxygen-pub ... ith-macros
Oxygen editor variables, like ${date(yyyy-MM-dd)}, are not available in WebHelp HTML fragments.
Instead, you can use one of the available webhelp macros. For the current case, you can use the $timestamp macro:
Code: Select all
<div class="generation_time">
<whc:macro value="${timestamp([h1]:[m01] [P] [M01]/[D01]/[Y0001])}"/>.
</div>
https://github.com/oxygenxml/oxygen-pub ... ith-macros
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 158
- Joined: Fri Nov 10, 2017 8:16 am
Re: Insert ate in webhelp output
Hi, Radu
Thanks for your help.
I tested the webhelp macro on both Oxygen V20 and Oxygen V21.
Seems the macro is not supported on Oxygen V20.
And, For Oxygen V21, still has a problem.
I set my html fragment as the following :
If I set the webhelp.fragment.footer to the HTML fragment, it works, and the date and time was displayed!! That's awesome!
And then, I tried to copy the codes to the page template wt_topic.html, and published webhelp using my customized template.
The date and time was displayed on each topic page.
However, the index page, search page, and term page in the published webhlep folder were blank!
I went to check my page templates, the wt_search.html, wt_terms.html, and wt_index.html, the page templates were not blank.
I guess the macro defined in the wt_topic.html would affect the other page templates.
Is there any way to fix it?
Regards,
Catherine
Thanks for your help.
I tested the webhelp macro on both Oxygen V20 and Oxygen V21.
Seems the macro is not supported on Oxygen V20.
And, For Oxygen V21, still has a problem.
I set my html fragment as the following :
Code: Select all
<div xmlns:whc="http://www.oxygenxml.com/webhelp/components">
<div class="generation_time">
Update Time: <whc:macro value="${timestamp([Y0001]-[M01]-[D01])}"/>
</div>
</div>
And then, I tried to copy the codes to the page template wt_topic.html, and published webhelp using my customized template.
The date and time was displayed on each topic page.
However, the index page, search page, and term page in the published webhlep folder were blank!
I went to check my page templates, the wt_search.html, wt_terms.html, and wt_index.html, the page templates were not blank.
I guess the macro defined in the wt_topic.html would affect the other page templates.
Is there any way to fix it?
Regards,
Catherine
-
- Posts: 404
- Joined: Thu Aug 21, 2003 11:36 am
- Location: Craiova
- Contact:
Re: Insert ate in webhelp output
Post by radu_pisoi »
Hi,
The WebHelp Responsive macros are available starting with 20.1 version, see What's New in Oxygen XML Webhelp 20.1.
This is the recommended method to modify the content of the generated HTML files. By modifying the page template files, you will not benefit for the changes we make in the template files when you update the WebHelp plugin.
We are not aware of a such issue. Could you send us on support@oxygenxml.com a test publishing template to reproduce the issue?
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service