Company | Newzulu Platform | Developer

Developer Template Documentation v4.12.2.47

fm:RemoteInclude


The RemoteInclude component allows you to include content from a remote location. A common use of this is to include the header content of an existing site in a new Newzulu Platform powered site.

Example

<fm:RemoteInclude cache="10" src="http://www.google.com/" type="safeHTML" />

This example will embed the HTML of the Google homepage in your template at the location of the RemoteInclude component. Note that we've marked this requested content as being safe HTML as we want to ensure we get valid XHTML in our page no matter what Google may send.

Supported attributes

NameRequiredDefaultDescription
cacheRequiredN/ASeconds to keep response in cache; use 0 to disable caching.
displaycodeOptionalThis will return HTML/XML as formatted code, works only for type html
srcRequiredN/AComplete URL of remote content.
timeoutOptional2Seconds to wait for response; if this time passes without a response the request will be considered a failure.
typeOptionalstlType of content being including. Controls how content will be handled before being sent to client.
stl
Remote content will be parsed as any template in Media Factory. This allows use of components as per usual.
safeHTML
Remote content will be filtered and transformed to form valid XHTML. This will remove any scripts as well.
html
Remote content will note be filtered or parsed as a template. Content will be output as-is, unless displaycode is set. This can also be used for XML.

Template variables

This component defines no template variables.

If the request for remote content fails (ie: timeout period expired) then either an exception will be thrown or the RemoteInclude's inner content will be rendered. It is highly recommended that you always provide inner content to ensure the user gets a reasonable page displayed.

Example with fallback content

<fm:RemoteInclude cache="10" src="http://www.google.com/" type="safeHTML"> Looks like Google might be down. How that happened, it is a mystery. </fm:RemoteInclude>
<< 3.2.60 fm:Recorder 3.2.62 fm:Rss >>