Page 1 of 1

Prepending text to title in template

Posted: Thu Feb 01, 2024 2:34 am
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?

Re: Prepending text to title in template

Posted: Thu Feb 01, 2024 8:59 am
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