XMetaL Tips and Tricks

XMetaL Community Forum XMetaL Tips and Tricks Info: Viewing and editing <alt> elements in images

  • Su-Laine Yeo

    Info: Viewing and editing <alt> elements in images

    Participants 3
    Replies 4
    Last Activity 13 years, 8 months ago

    When displaying a document that contains an image, a limitation of XMetaL is that it cannot simultaneously show both the actual image and a sub-element of the element, such as an element. You also cannot insert an element for an image if the image is displayed.

    To work with elements within images, click View > Hide Inline Images. This will hide images, but allow you to view, edit, and insert elements in both Normal and Tags On views.

    DITA users can also use the Insert Image or Figure or Image or Figure Properties dialogs to view, edit, and insert elements. See the additional notes below.

    Additional notes on the element in DITA

    The DITA 1.1 language reference says, “The alt element provides alternate text for an image. It is equivalent to the alt attribute on the image element; the attribute is deprecated, so the alt element should be used instead. As an element, alt provides direct text entry within an XML editor and is more easily accessed than an attribute for translation.”

    Because “alt text” can be stored in either an attribute or an element, XMetaL's dialogs for editing image properties use some special logic to support either choice:
    – If the alt attribute does not have a value, anything typed into the Alt Text field goes into the alt element when the user clicks OK (the system creates an alt element if needed).
    – If the alt attribute has a value, and there is no alt element, the Alt Text field displays the contents of the alt attribute, and anything in this field is saved to the alt attribute, not the element, when the user clicks OK.
    – If the alt attribute has a value, and there is also an alt element, the Alt Text field displays the contents of the alt element, and anything in this field is saved to the alt element when the user clicks OK.

    The dialogs are designed to encourage use of the element, while ensuring that people using the alt attribute wouldn’t have their data seem to disappear. Note that XMetaL does not move content from alt attributes to elements, or vice-versa.

    Reply

    ghkrause

    Reply to: Info: Viewing and editing <alt> elements in images

    Thank you for this info!

    Reply

    paorear

    Reply to: Info: Viewing and editing <alt> elements in images

    It appears that this limitation is not DITA-specific, is that correct? For example, in our schema, we have an element for which we display a placeholder image using 'Display As' = XFT, and the XFT is essentially just a small graphic.

    I'm investigating an issue where child elements are not being displayed in this context – is that because of this same limitation?

    Reply

    Derek Read

    Reply to: Info: Viewing and editing <alt> elements in images

    Correct, this is true for any schema, not just DITA.

    XFT is the same, so if the XFT you are embedding replaces the element you will need to design it to cover all the content you want to allow to be editing, including child content. You have absolute control over everything in an XFT though, so if properly designed it can allow the user to see and edit all content provided you expose that content in the XFT on the controls you embed in the XFT.

    If you are embedding XFT before or after an element (instead of replacing the whole element) then things get more complicated. See this thread: http://forums.xmetal.com/index.php/topic,3348.0.html

    Reply

    paorear

    Reply to: Info: Viewing and editing <alt> elements in images

    [XMetaL Authoring Essentials 8]

    Thanks Derek – I had read that other thread yesterday as well.

    Here's a scenario I'm trying to solve. I currently have the following working:

          XFT placeholder image

    Where the XFT is embedded and essentially just a graphic to show that an image would be displayed there at rendering time.

    In some scenarios, we have a child element that would make the image into a hotlink. e.g.
         

    In all these cases the data we track is in attributes of the tags themselves – not any value data between elements.

    Currently, I am unable to display the element in the editor, presumably due to the XFT that we have associated with the element. I tried defining the XFT as embedded and to be before element, but it didn't seem to have any impact either on where the XFT was displayed or whether the element would also be displayed. Is what I'm trying to do possible? or perhaps I just didn't quite get it defined and setup correctly.

    Reply

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

Lost Your Password?

Products
Downloads
Support