Pages: 1
Print
Author Topic: CSS style for read-only files  (Read 1548 times)
leo71
Member

Posts: 25


« on: June 09, 2015, 03:06:16 AM »

There are special CSS entries like:
Code:
$DOCUMENT - Set CSS style rules for the whole document
$MARKSEC - Set CSS style rules for marked sections
$COMMENT - Set CSS style rules for Comment Tags
$PROCINS - Set CSS style rules for Processing Instructions

Is there anything available to apply styling to read-only (file system/CMS) files?
Code:
$DOCUMENT[READONLY] {
  background-color: gray;
}
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2579



WWW
« Reply #1 on: June 09, 2015, 03:47:13 PM »

There aren't any special XMetaL-specific (non-standard) CSS selectors beyond what you have quoted.

What "read only" means will depend on the context (file system file attribute, special markup in the XML itself, information coming from a CMS system) and XMetaL Author doesn't implement any special handling for these things. Over the years we have seen these features implemented by clients in many different ways to meet specific user needs and so we simply provide APIs to allow you to build the feature to meet those needs.

Depending on the context you will need to determine whether a file should be treated as read only using different APIs and possibly information from outside of XMetaL (Windows FSO, information passed in from a CMS, etc). Once that has been decided you can then style any portion of the document using the ContainerStyle property. Keep in mind that CSS cascading rules still applies after you set this property. See the Programmers Guide for details on its use.

If you are working with a CMS system it is best to check with the vendor that provides the CMS connector for XMetaL Author Enterprise to see if such a feature already exists. Some CMS systems have a "check out for viewing only" or similar feature. In this case, if the file is locked by someone else they usually include a feature that warns you somewhere in the XMetaL UI. This is implemented in various different ways depending on the connector (CSS, a warning dialog, or sometimes in the Resource Manager if the CMS includes a UI embedded in there). In some cases the CMS connector will also stop you from modifying the document. We provide APIs for that named ReadOnly and NonRemovableContainer.
Logged
Pages: 1
Print
Jump to: