|
|||||||||||||||||||||||||||||||||||||||||
|
The $$INCLUDE$$ and $$INSERT$$ directives both display content from elsewhere than site HTML content. That is, a mandatory parameter is the source of what is to be included/inserted. These are an effective mechanism for including dynamic content from the same or different site. This is quite a useful facility!This basic include would place the home page of the site into a scrolling viewport within the current page. $$INCLUDE$/$$ Inclusion / Insertion?The basic difference between including and inserting content, is an inclusion is obvious, with a border and scrollbars as necessary. With an insertion VWcms places the content in-line to the main content of the page. It is much less obvious that it has been retrieved from elsewhere. Parameters
Examples are provided in the next section ... URL ContentURL content is any web address supported by the browser, such as http://wasd.vsm.com.au/ and any source not an obvious URL is considered a local web resource /wasd_root/src/ Note that insertion can only effectively be used for URLs from the same host. Browser security sandboxing will severely constrain the presentation of URLs from other hosts. The following will not work well. $$INSERT$http://www.w3c.org/$$ Site ContentIn addition to the content of the current section others from the VWcms site may be included and inserted into the current page. This can be done using the $$CONTENT$$ directive and providing the section name/path as a parameter, or explicitly using the $$INSERT$$ or $$INCLUDE$$ directives described in this section. Inclusions of site content cannot be nested. File ContentLocal file-system content may be directly included and inserted into the current page. Relative (to the site location) and absolute VMS file specifications can be used. This allows files from anywhere in the file-system to be accessed provided the account executing VWcms has the appropriate read permission. HTML File ContentThe content of a file can be inserted unchanged into the text of a page. Of course it should contain legitimate HTML (XHTML in fact). Of course directly inserting HTML can disrupt the formating and layout or even disable the functioning of VWcms. This example would insert the HTML contained in the file directly into the current page. $$INSERT$height=250px$source=html:///web:[tables]one.html$$ Plain-Text File ContentHTML-significant characters can be escaped for presentation. This effectively displays a file as plain-text. This example would include this site's (VWcms' documentation) template file (which is in fact HTML). $$INCLUDE$height=250px$source=plain:///_site.txt$$ Spawned ContentIf DCL spawning is enabled the URL scheme spawn:/// will execute a DCL command in the context of the scripting account. Spawning content is a relatively latent and expensive operation. Output of the following spawned command must be HTML. $$INCLUDE$spawn:///show time$$ The URL scheme splain:/// executes the DCL command and renders the output as plain-text. $$INSERT$splain:///show system$$ Spawned content must be enabled by the system administrator on a per-site basis.
|
|||||||||||||||||||||||||||||||||||||||||