DITA and XMetaL Discussion
Scibert August 16, 2012 at 5:43 pm
Preventing insertion of <linktext> in related linksAugust 16, 2012 at 5:43 pmParticipants 5Replies 6Last Activity 10 years, 1 month ago
In XMetaL 7, when you add a related link by clicking Insert > Link > Related Link To Topic, the link is automatically wrapped with a
element. Is there a way to prevent this behavior?
For example, I want this code to be inserted…
…instead of…Derek Read August 16, 2012 at 10:19 pm
Reply to: Preventing insertion of <linktext> in related linksAugust 16, 2012 at 10:19 pm
This can be done but you must be careful.
1. Open the corresponding CTM file for the topic type you wish to change this for in a text editor (like Notepad).
“topic” DTD for DITA 1.2
C:Program FilesXMetaL 7.0AuthorDITAXACs1.2topictopic_ditabase.ctm
“concept” DTD for DITA 1.1
C:Program FilesXMetaL 7.0AuthorDITAXACs1.1conceptconcept_ditabase.ctm
2. Locate the following section:
3. Change to:
4. Save the CTM file.
5. Repeat as necessary for each DITA document type you need to alter.
If you mess this up somehow then reinstalling the software should restore any CTM files you have broken.
Note: This may not work for every “template” due to the way the DITA functionality has been scripted. In most cases the code that inserts elements uses the template in the CTM file (by calling the API “InsertWithTemplate”) but in some cases it does not. It just happens that for it does.
Officially this type of change is not supported, even though it should work in this case. What “unsupported” means here is that if an end user contacts saying that the
is not being inserted (without letting anyone know CTM changes were made, which is very likely) we won't be able to reproduce the issue. XMetaL Support (if that channel is used) would end up having the end user reinstall the software to put it into a standard state, at which point the issue would go away, but any customizations would disappear as well. So, if you make these types of changes make sure your end users contact you for help.Scibert August 16, 2012 at 11:53 pm
Reply to: Preventing insertion of <linktext> in related linksAugust 16, 2012 at 11:53 pm
This solution works. Thanks!scorho August 30, 2012 at 4:33 pm
Reply to: Preventing insertion of <linktext> in related linksAugust 30, 2012 at 4:33 pm
I suspect that the OP wants to do this due to an issue we're seeing as well. In XM6, the
tag was not inserted, and related links worked fine. In xm7, the tag actually makes it so link text is NOT generated.
The link is actually created in the html output, but the link text appears as empty white space in the html code, so it does not actually display at all. Remove that
tag and everything works as expected.Derek Read August 31, 2012 at 12:07 am
Reply to: Preventing insertion of <linktext> in related linksAugust 31, 2012 at 12:07 am
I see. I'll check with dev to see if they were thinking something else when they made this change and recommend they revert it.Scibert September 4, 2012 at 7:20 pm
Reply to: Preventing insertion of <linktext> in related linksSeptember 4, 2012 at 7:20 pm
After changing the code to …
… the link's topic name no longer appears in the authoring interface — the string “Link” is always displayed instead.
How can this be fixed?Derek Read September 5, 2012 at 8:31 pm
Reply to: Preventing insertion of <linktext> in related linksSeptember 5, 2012 at 8:31 pm
Don't include the PI you are including in the mini-template and things should be OK. See the change I made in my previous post.
Note that in XMetaL Author Enterprise 7.0 you can control how references and other things are updated when “refreshing references” (F11) at a much finer level than with 6.0. These settings are in Tools > DITA Options > Update Content (tab). There is a section on the right labelled “Reference types”. The setting that controls this particular type of reference is the checkbox labelled “xref/related-links”.
- You must be logged in to reply to this topic.