Conditional logic for code template
Oxygen general issues.
-
- Posts: 7
- Joined: Fri Jan 02, 2015 1:09 pm
Conditional logic for code template
I've created a code template for use when authoring content. It does a nice job of prompting the user for a value, which is then wrapped in a specific element (which has a specific attribute).
I'd like to extend this so that the value of ${selection} is evaluated, and if this is not empty then we simply wrap the current selection. Only if there is no selection would we prompt the user for a value.
Can this be done? I'm using oXygen 17.1
Current Code:
Desired (pseudocode):
I'd like to extend this so that the value of ${selection} is evaluated, and if this is not empty then we simply wrap the current selection. Only if there is no selection would we prompt the user for a value.
Can this be done? I'm using oXygen 17.1
Current Code:
Code: Select all
<keyword otherprops="g.signal.name">${ask('Please provide the signal name.')}</keyword>
Code: Select all
if ($selection=="") {
<keyword otherprops="g.signal.name">${ask('Please provide the signal name.')}</keyword>
} else {
<keyword otherprops="g.signal.name">${selection}</keyword>
}
-
- Posts: 9439
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Conditional logic for code template
Hi Charles,
Sorry but we do not have such possibilities of evaluating conditions when using code templates.
If you are editing in the Author visual editing mode you should consider creating Author actions which can call operations, either implemented in Java or Javascript-based:
https://www.oxygenxml.com/doc/versions/ ... tions.html
Regards,
Radu
Sorry but we do not have such possibilities of evaluating conditions when using code templates.
If you are editing in the Author visual editing mode you should consider creating Author actions which can call operations, either implemented in Java or Javascript-based:
https://www.oxygenxml.com/doc/versions/ ... tions.html
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
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