InterJinn

Development Framework For PHP

Tag: <jinn:source/>

Abstract

You can load an external source file into the current content where this tag is placed. The contents of the included source file will be processed for any tags or embeds.

Attribute - path

Set this attribute to the location of the source file for which the contents should be included. If the source file path begins with // then the source file path will be considered relative to the compileSourcePath that you set in the project configuration. If the path is preceded by / then the source file will be retrieved relative to the root of the filesystem. Last, if neither of the former two cases are true then the path will be treated as being relative to the last nested source file path. You should make sure that read permission is set for the appropriate owners at this location.

The recent addition of the Content Manager Service has added the option to load content via any number of different methods. To specify the exact method you must use the following styles for your path:

Examples:
file:////mainLayout.template
sql:///templates/main.template

There are three parts to the examples and specifically for the first example: the type specifier file, the separator ://, and the path //mainLayout.template. If you do not specify the type portion of the path, then the value configured in the $GLOBALS['interJinn']['contentDefaultType'] property will be used to determine the type. If this property has not been set then file is assumed.

It's useful to note that the functionality of the <jinn:source/>, <jinn:template/>, and <jinn:file/> tags are pretty much the same except that the base directory differs when using the relative prefix. The reason for this redundancy is mostly to create a separation of purpose and subsequently adding clarity to the content.

Example:
<jinn:source path="//forms/contact.source"/>