Pages: 1
Print
Author Topic: How do I modify which elements are inserted when pressing Enter in DITA Tasks?  (Read 3411 times)
santhoshkumarr
Member

Posts: 7


« on: December 03, 2008, 11:45:18 PM »

Hi Derek,

Could you please help me with this issue:

In a Task topic file, when I add a "step" element i don't want the "stepresult" element to add automatically. How do i fix this in XMetaL DITA?

Best Regards,
Santhosh.
« Last Edit: December 09, 2008, 02:23:23 PM by Derek Read » Logged
mag3737
XMetaL Evangelist
Administrator
Member

Posts: 100


I even use XMetaL to write my business letters.


« Reply #1 on: December 04, 2008, 11:51:50 AM »

1. Save a backup copy of the following file:
C:\Program Files\XMetaL 5.1\Author\DITA\XACs\task\task_ditabase.ctm

2. Open it in any text editor.

3. Find the line of code that looks like this (below).  In my copy of XMetaL it's at line# 1769.  (This is XMetaL Author Enterprise 5.1, but I fiddle all the time and I don't remember if I have made other changes to my CTM before.)  Also note that this is a single line of text:

Quote
<MiniTemplate><![CDATA[<step><cmd><?xm-replace_text Step?></cmd><stepresult><?xm-replace_text Step Result?></stepresult></step>]]></MiniTemplate>

4. Change it to this:

Quote
<MiniTemplate><![CDATA[<step><cmd><?xm-replace_text Step?></cmd></step>]]></MiniTemplate>

5. Restart XMetaL.

You'll probably have to re-do this procedure whenever you upgrade your version of XMetaL, as the installer will probably overwrite it.
Logged

Tom Magliery
JustSystems Canada, Inc.
santhoshkumarr
Member

Posts: 7


« Reply #2 on: December 04, 2008, 09:48:53 PM »

Hi Tom,

Thanks for your reply. I followed the steps you provided and edited the code in the CTM file. However, this didn't work. Do I have to make similar changes in any other XMetaL config files?

Warm Regards,
Santhosh.
Logged
Su-Laine Yeo
Solutions Consultant
Member

Posts: 260


« Reply #3 on: December 05, 2008, 01:11:57 PM »

The CTM changes that Tom described above change the behavior for <step> elements inserted through the Element List or the Insert menu. They don't change the behavior for <step> elements inserted when you press the Enter key.

It is possible to change the CTM in order to have the <stepresult> element not appear in <step> elements that are inserted with the Enter key. I've tried this and don't recommend doing it though. As I recall, when you press the Enter key, the insertion point will go into a place that's not optimal, (i.e. not the next <cmd> element) and pressing Enter again is also not optimal. We need to overhaul the whole area of Enter key behavior in <step> elements in a future release.
Logged

Su-Laine Yeo
Solutions Consultant
JustSystems Canada, Inc.
Su-Laine Yeo
Solutions Consultant
Member

Posts: 260


« Reply #4 on: December 05, 2008, 07:12:53 PM »

Oops, when I said, "They don't change the behavior for <step> elements inserted when you press the Enter key" what I should have said was, "They don't change the behavior when you press the Enter key after typing in a <cmd> element."

Tom's changes above do change the behavior for wherever the <step> element is inserted.
Logged

Su-Laine Yeo
Solutions Consultant
JustSystems Canada, Inc.
santhoshkumarr
Member

Posts: 7


« Reply #5 on: December 07, 2008, 11:03:28 PM »

This didnt work when I tried with the the "Insert" key. Let me explain what I have done and what I haven't:

I have done:
Edited the task_ditabase.ctm file, changed the Minitemplate. Removed the <stepresult> tag.

I havent done:
Editing the macro's
On_ElementList_Insert
On_ElementList_Change
On_ElementList_Surround
On_ElementList_Insert_NoRequired

Kindly let me know if I had to modify any other file.

Regards,
Santhosh.
Logged
mag3737
XMetaL Evangelist
Administrator
Member

Posts: 100


I even use XMetaL to write my business letters.


« Reply #6 on: December 08, 2008, 10:12:43 AM »

You should not have to modify anything except the CTM for this change.  I'm following up with you in email.  Once we have solved your problem, if there is any further clarification necessary, I'll post back here to the forum for everyone's information.
Logged

Tom Magliery
JustSystems Canada, Inc.
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 1553



WWW
« Reply #7 on: December 09, 2008, 02:45:56 PM »

The best we can do in this case is to modify the CTM file. This is something we can support. In addition to this however, the DITA functionality includes a feature we refer to as "smart insert". This is implemented via script and we do not support clients making modifications to the scripts at this time, nor are there any config files or other means for modifying this behavior. This feature might be getting in the way in this instance.

In the future we hope to extend this functionality to give you more flexibility in configuring these settings and allow you to override the smart insert behavior to get it to do exactly what you want.

When (and even if) that work will be done we cannot say at this time as such a feature will be competing with all the others we are working on.
Logged
Pages: 1
Print
Jump to: