A Simple Block/Tag Translator Example - MACROMEDIA DREAMWEAVER 8-EXTENDING DREAMWEAVER Manual

Extending dreamweaver
Table of Contents

Advertisement

returnArray[0] = "Pound_Conditional";
returnArray[1] = "Pound Conditional Translator"; // The title
returnArray[2] = "2";
returnArray[3] = "html";
returnArray[4] = "htm";
returnArray[5] = "1";
returnArray[6] = "<#";
returnArray[7] = "byString";
returnArray[8] = "50";
return returnArray
}
</script>
</head>
<body>
</body>
</html>
3.
Save the file as Poco.htm in the Configuration/Translators folder.

A simple block/tag translator example

To help understand translation, look at a translator that is written entirely in JavaScript,
which does not rely on a C library for any functionality. The following translator example
would be more efficient if it were written in C, but the JavaScript version is simpler, which
makes it perfect for demonstrating how translators work.
As with most translators, this one is designed to mimic server behavior. Assume that your web
server is configured to replace the
on the day of the week, the time of day, and the user's platform. The translator does the same
thing, only locally.
To create the block/tag translator:
1.
Create a new blank file.
2.
Enter the following code:
<html>
<head>
<title>Kent Tag Translator</title>
<meta http-equiv="Content-Type" content="text/html; charset=">
<script language="JavaScript">
/**********************************************************
* The getTranslatorInfo() function provides information
* about the translator, including its class and name,
* the types of documents that are likely to contain the
// The number of extensions
// The first extension
// The second extension
// The number of expressions
// The first expression
//
tag with a different picture of an engineer, depending
KENT
A simple block/tag translator example
// The translatorClass
//
*
*
*
447

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DREAMWEAVER 8-EXTENDING DREAMWEAVER and is the answer not in the manual?

This manual is also suitable for:

Dreamweaver 8

Table of Contents