Here's an example EWD page containing an EWD include. Includes allow you to re-use blocks of markup and avoid code replication.
<ewd:config prePageScript="##class(ewd.examples).getMyData"> <html> <head> <title>EWD Include Example</title> </head> <body> <h4>Example of use and Include</h4> <ewd:include file="commonMarkup.inc" /> </body> </html>
An include file is simply a file of EWD-compatible markup, and can include:
For example, commonMarkup.inc might contain the following:
<div>Hello <?= #world ?></div> <a href="myNextPage.ewd">Go to the next page</a> <ewd:set return="$x" value="#myX"> <p>The value of $x is <?= $x ?></p>
Include files should have a file extension of .inc and should physically reside in the same path as the application's EWD source (.ewd) files. Includes are incorporated into their container page at compile time, so any references to session and local variables use the values relative to the container page at the time it is rendered (ie at run-time). They can therefore be useful and simple substitutes for EWD custom tags.