Template Prompts Not Working
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 6
- Joined: Wed Apr 04, 2012 9:28 pm
Template Prompts Not Working
Hi, there,
I have success with editor variables in code snippets that will automatically populate (such as ${date(yyyy-MM-dd)} and ${date(MMMM dd, yyyy)}
However, when I have tried to implement document templates and code snippets that will produce a prompt upon run, these editor variables are placed into the document as text. I have followed the pattern from the help screens and manual, but to no avail:
${ask('user-message', param-type, 'default-value' ?)}
-->
${ask('What is your name?', generic, 'default' ?)}
I have tried many variations, but I cannot get values prompts at run time when I try to create new documents.
When reading through the sample code templates, I notice that not a single snippet uses ask prompts, instead only being code with a ${caret} placement. (Contrast those examples with the free NoteTab program, in which I was able to create numerous clip libraries and run prompts that make this free program in some ways much more robust with XML creation than what I have with Oxygen at present. I am crossing my fingers that it's a simple fix...)
I find this disappointing and frustrating. I am hoping there is a small step I'm missing along the way. I'd appreciate any advice from others who have solutions to offer!
Thanks!
I have success with editor variables in code snippets that will automatically populate (such as ${date(yyyy-MM-dd)} and ${date(MMMM dd, yyyy)}
However, when I have tried to implement document templates and code snippets that will produce a prompt upon run, these editor variables are placed into the document as text. I have followed the pattern from the help screens and manual, but to no avail:
${ask('user-message', param-type, 'default-value' ?)}
-->
${ask('What is your name?', generic, 'default' ?)}
I have tried many variations, but I cannot get values prompts at run time when I try to create new documents.
When reading through the sample code templates, I notice that not a single snippet uses ask prompts, instead only being code with a ${caret} placement. (Contrast those examples with the free NoteTab program, in which I was able to create numerous clip libraries and run prompts that make this free program in some ways much more robust with XML creation than what I have with Oxygen at present. I am crossing my fingers that it's a simple fix...)
I find this disappointing and frustrating. I am hoping there is a small step I'm missing along the way. I'd appreciate any advice from others who have solutions to offer!
Thanks!
-
- Posts: 9449
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Template Prompts Not Working
Hi,
So from what I understand you tried to use the $ask editor variables in two contexts:
1) In the new file templates used to create new documents.
2) In new code templates used to insert small snippets of XML code.
(1) was not yet implemented but I added an improvement request and we'll update this thread when it happens.
(2) was implemented in Oxygen 13.0 so if you have an older version of Oxygen this would explain why ask editor variables in the content of code templates would not work for you.
Basically when editing a code template you have a drop-down button showing you the available editor variables and if the editor variable is contained in the list then it should definitely work.
Regards,
Radu
So from what I understand you tried to use the $ask editor variables in two contexts:
1) In the new file templates used to create new documents.
2) In new code templates used to insert small snippets of XML code.
(1) was not yet implemented but I added an improvement request and we'll update this thread when it happens.
(2) was implemented in Oxygen 13.0 so if you have an older version of Oxygen this would explain why ask editor variables in the content of code templates would not work for you.
Basically when editing a code template you have a drop-down button showing you the available editor variables and if the editor variable is contained in the list then it should definitely work.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 6
- Joined: Wed Apr 04, 2012 9:28 pm
Re: Template Prompts Not Working
Thank you for your reply! I have the Editor 13.2 package, which I believe is the most current.
So you are saying that support for $ask within document templates has not yet been implemented for document templates? How very strange. I hope this is remedied soon. It was one of the most helpful features of NoteTab when managing a fleet of authors and editors. Thank you for submitted an improvement request. You will have many happy project managers, I imagine!
As to the code templates, aha! Following your suggestion, when I used the dropdown menu rather than typing the code myself, the $ask worked. But this is also strange, as the actual text (once I customized the message and input type) is the exact same as what I typed myself. I will use the dropdown from now on but is there a way to request this issue be looked at, as well?
Thanks again for your responsiveness!
So you are saying that support for $ask within document templates has not yet been implemented for document templates? How very strange. I hope this is remedied soon. It was one of the most helpful features of NoteTab when managing a fleet of authors and editors. Thank you for submitted an improvement request. You will have many happy project managers, I imagine!
As to the code templates, aha! Following your suggestion, when I used the dropdown menu rather than typing the code myself, the $ask worked. But this is also strange, as the actual text (once I customized the message and input type) is the exact same as what I typed myself. I will use the dropdown from now on but is there a way to request this issue be looked at, as well?
Thanks again for your responsiveness!
-
- Posts: 9449
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Template Prompts Not Working
Hi,
I think that you copy/pasted the question mark from our user manual where we intended it to signal that the last parameter was optional.
I guess we should have explained the third parameter as being optional in the user manual instead of adding that question mark there.
Regards,
Radu
The samples which you posted in the first post contained an extra question mark character ? so this is why they did not work.Following your suggestion, when I used the dropdown menu rather than typing the code myself, the $ask worked. But this is also strange, as the actual text (once I customized the message and input type) is the exact same as what I typed myself.
I think that you copy/pasted the question mark from our user manual where we intended it to signal that the last parameter was optional.
I guess we should have explained the third parameter as being optional in the user manual instead of adding that question mark there.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 6
- Joined: Wed Apr 04, 2012 9:28 pm
Re: Template Prompts Not Working
I realized the third parameter was optional from the definition: "'default-value' - optional parameter. Provides a default value in the input text box." Adding a question mark *is* unnecessary, and rather misleading: "To prompt for values at runtime, use the ask('user-message', param-type, 'default-value' ?) editor variable." (http://www.oxygenxml.com/doc/ug-editorE ... lates.html)
Is it possible to create:
* Dropdown lists for users (e.g. an $ask prompt with controlled choices)
* A code template that supports multiple $ask requests
If not, I'd like to submit improvement requests.
Thanks again!
Is it possible to create:
* Dropdown lists for users (e.g. an $ask prompt with controlled choices)
* A code template that supports multiple $ask requests
If not, I'd like to submit improvement requests.
Thanks again!
-
- Posts: 9449
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Template Prompts Not Working
We already have an improvement request for this, I added your vote and we'll update the forum thread when it gets implemented.* Dropdown lists for users (e.g. an $ask prompt with controlled choices)
Yes, this should be possible.* A code template that supports multiple $ask requests
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 6
- Joined: Wed Apr 04, 2012 9:28 pm
Re: Template Prompts Not Working
Great on the dropdown lists improvement request! Crossing my fingers as such an improvement will allow me to better advocate that my colleagues get Oxygen XML.
As to the second, when I have multiple $asks (using the code template dropdown!) in a code template, it will only run the last $ask. Any advice?
As to the second, when I have multiple $asks (using the code template dropdown!) in a code template, it will only run the last $ask. Any advice?
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Template Prompts Not Working
Post by sorin_ristache »
Hello,
Regards,
Sorin
I created a code template with two ${ask} variables and Oxygen asked me to enter a value for each one with a separate dialog box. Please post here the entire content of your code template and specify the associated editor type (XML editor, XSL editor, all editors, etc) for reproducing the problem.atross13 wrote:As to the second, when I have multiple $asks (using the code template dropdown!) in a code template, it will only run the last $ask. Any advice?
Regards,
Sorin
-
- Posts: 6
- Joined: Wed Apr 04, 2012 9:28 pm
Re: Template Prompts Not Working
I figured out that the code templates break down when I include a comma in the values area of the ${ask} prompt, whether in real value or rendered value. I tried using HTML entity codes, but the code template still doesn't work. I've used code templates successfully in many variations, until I need commas in the values. Thoughts?
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Template Prompts Not Working
Post by sorin_ristache »
Hello,
Thank you for reporting this problem. Is the effect that you get the insertion of the template definition instead of the result of replacing the ask value? For example if I test a code template with the definition:
but I modify it and insert a comma in either value1 or rendered_value1 the popup dialog box is not displayed anymore and the raw template definition is inserted at cursor location. We will fix this problem in a future version.
Please avoid using non-alphanumeric characters in an ${ask} parameter if you can until we fix the problem in a future version.
Regards,
Sorin
Thank you for reporting this problem. Is the effect that you get the insertion of the template definition instead of the result of replacing the ask value? For example if I test a code template with the definition:
Code: Select all
<a>${caret}${ask('Message', combobox, ('value1':'rendered_value1'), 'Default_value')}</a>
Please avoid using non-alphanumeric characters in an ${ask} parameter if you can until we fix the problem in a future version.
Regards,
Sorin
-
- Posts: 9449
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Template Prompts Not Working
Hi,
Sorry about this, we'll try to fix this in Oxygen 16.1.
In the meantime, there are more than one character which are rendered as comma by a certain font.
As a workaround you could try to copy from the code block below and use this symbol:
It is the small comma character:
http://www.fileformat.info/info/unicode ... /index.htm
It should render as a comma but its character code equivalent is different from the one of the standard comma and Oxygen should be able to parse it properly.
Regards,
Radu
Sorry about this, we'll try to fix this in Oxygen 16.1.
In the meantime, there are more than one character which are rendered as comma by a certain font.
As a workaround you could try to copy from the code block below and use this symbol:
Code: Select all
﹐
http://www.fileformat.info/info/unicode ... /index.htm
It should render as a comma but its character code equivalent is different from the one of the standard comma and Oxygen should be able to parse it properly.
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)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ 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