Changing the content type of a design element
Table of contents
, also known as MIME type, specifies the nature of a resource. The content type is used to specify the nature of a data in the body of a MIME entity, by giving media type and subtype identifiers, and by providing auxiliary information that may be required for certain media types. Examples of content types include "text/html", "image/png", "image/gif", "video/mpeg", "text/css", and "audio/basic". Thus, despite the fact that a file can have an .htm extension, if it does not have a "text/html" header content type, it is not rendered on a browser as a common hypertext Web page. The same can happen with images, video clips and many others.
Domino provides a way to change the content type header of some elements. In the next section, we explain how to achieve this on several design elements.
Changing the content type to HTML
To change the content type of a form or page to HTML, in the design element Properties box, on the Basics tab, for Web Access, select HTML for Content type.
Setting the content type of a page design element to text/html
When this setting is applied, all the content of a form is rendered as is. You do not need to format text using Notes rich text or pass through HTML setting to the text.
When a content type different from the default (Notes
) is set, all the design element properties, such as window title, JS header code, and so on, are lost, and the page is treat as text. The unique portion of code evaluated by the Web browser is the plain text entered on the design element body.
Changing the content type to XML
To change the content type of a form or page to XML, in the design element Properties box, on the Basics tab, for Web Access, select Other for Content type and an enter the value "application/xml" on the input box.
Setting the content type of a design to application/xml
Agents can be used to write custom content on the Web. Designers can take advantage of this, and change the content type of an agent called from an URL to write an specific content. To achieve this, make sure that the first line "printed" from your agent is the definition of its content type (header information).
Print "Content-type: text/xml " & Chr(13)
The previous example demonstrates how to change the content type of an agent on run-time to XML using the LotusScript Print statement. This can be used to display custom XML data, like RSS feeds.
To call an agent from an URL that writes data for the user on-the-fly, in the agent properties box, on the Basics tab, for Runtime, set Trigger to On event
. Then select Agent list selection
, and set Target to None
Setting an agent to be invoked from an URL and print data
For information about how to work with the Doctype declaration on a Web page, refer to Working with the DOCTYPE.