Prepending text to title in template

Post here questions and problems related to editing and publishing DITA content.
shudson310
Posts: 156
Joined: Sat Feb 26, 2005 12:09 am
Location: USA
Contact:

Prepending text to title in template

Post by shudson310 »

Hi, I'm trying to prepend some text at the start of a title in a topic template. Unfortunately, if the user puts anything in the title prompt (using a properties file with type=dita), that title overrides anything I put in a wizard in the actual template.
Here's what I have in the task template:
<title>General guidelines for ${ask('General guidelines for?', String, '', @task-title)}${answer(@task-title)}</title>

How can I use the value from the wizard, rather than the title field in the New dialog? How do I set the priority to the wizard over the New dialog?
Scott Hudson
Staff Content Engineer
Site: docs.servicenow.com
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Prepending text to title in template

Post by Radu »

Hi Scott,
Off topic, if you are not using the @task-title variable in multiple places in the new file template this:

Code: Select all

${ask('General guidelines for?', String, '', @task-title)}${answer(@task-title)}
can be simplified to this:

Code: Select all

${ask('General guidelines for?')}
The title set by the end user in the New dialog wizard has more priority than the title you placed in the new file template.
We do not have a workaround for this as the end user is in control here.
How about if you do not add ask editor variables in the new file template and instead add some Schematron check which reports a warning to the end user until they properly write the title content?
Or how about if you add the "General guidelines for" prefix as a publishing customization instead?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply