DITA and XMetaL Discussion

XMetaL Community Forum DITA and XMetaL Discussion Preventing insertion of <linktext> in related links

  • Scibert

    Preventing insertion of <linktext> in related links

    Participants 5
    Replies 6
    Last 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…

    Reply

    Derek Read

    Reply to: Preventing insertion of <linktext> in related links

    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).

    Examples:

    “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.

    Reply

    Scibert

    Reply to: Preventing insertion of <linktext> in related links

    Hi Derek,

    This solution works. Thanks!

    Reply

    scorho

    Reply to: Preventing insertion of <linktext> in related links

    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.

    [img]http://beta-microsite.omniture.com/t2/testdoc/img/rlt.png[/img]

    results in:

    [img]http://beta-microsite.omniture.com/t2/testdoc/img/rlt2.png[/img]

    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.

    Reply

    Derek Read

    Reply to: Preventing insertion of <linktext> in related links

    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.

    Reply

    Scibert

    Reply to: Preventing insertion of <linktext> in related links

    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?

    Reply

    Derek Read

    Reply to: Preventing insertion of <linktext> in related links

    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”.

    Reply

  • You must be logged in to reply to this topic.

Lost Your Password?

Products
Downloads
Support