General XMetaL Discussion

XMetaL Community Forum General XMetaL Discussion Showing attributes with element

  • sapraaman

    Showing attributes with element

    Participants 0
    Replies 1
    Last Activity 12 years ago

    Hi,

    Is it possible to display all the attributes of an element in the editor (next to element)? Is there a global option or something which enables that. Currently, the mouse cursor needs to be hovered on the element or attribute inspector needs to be displayed.

    We are using XMetal 5.5

    Thanks,
    Aman

    Reply

    Derek Read

    Reply to: Showing attributes with element

    You can do this with CSS or inside an XFT.

    In CSS you can do something like so:

    selector:before {
    display:block;
    border: 1px solid blue;
    content: "Attributes:00a009" attr(attrName1) "00a009" attr(attrName2);
    }

    The xxxx Unicode character escaping notation in this case allows you to insert characters you might otherwise not be able to insert into a CSS content string (in my example carriage return and tab). This escaping is an undocumented and unofficial feature.

    An older feature that still happens to work but that has not been documented since XMetaL 3.1 is this one:

    selector {
    prefix-format: "%attribute-list;";
    }

    • It must be specified as above, though you may include additional text inside the quotation marks before and after the %attribute-list; portion (which is what triggers the attribute values to be rendered).
    • Attributes with a value are listed in the form attrname=”value” with spaces between each one.
    • Attributes without a value are not listed.
    • The selector must not use :before or :after.
    • It only displays when in Tags On view not Normal view.

    We probably no longer document this as it predates the official CSS “attr”, “before” and “content” keywords, and it is an XMetaL-only proprietary CSS property (SoftQuad had a few people on the CSS working groups up to CSS2 so likely they pushed for our version but apparently not hard enough). It is also “all or nothing”: you don't get to pick which attributes to show and you don't get to mess with additional content like my previous example. The one convenience it provides is a quick way to show all attributes that have values without needing to list each name.

    Reply

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

Lost Your Password?

Products
Downloads
Support