Login

Vectors

Vector: entity

The entity vector is used to extract data from the model. It consists of 2 or 3 parts, depending on context. When used in normal conditions, it follows the format:

[vector name of table].[record id].[vector name of field]

If the entity vector is used within a {{repeat}} or {{paging}} vector, the Vectoran engine is smart enough to know which record is active in the current loop so the record id is not necessary. The result is:

[vector name of table].[vector name of field]

If the field is of type media (a picture is uploaded instead of text being typed in), then the vector will return the full URL of the media item. That can then be placed within an image or anchor tag.

The Vectoran engine is also smart enough to traverse foreign key relationships. If you have a table with a field that references a record in another table, you can get the referenced table's values very easily using the following format:

[vector name of table].[vector name of field].[vector name of field on referenced table]

There may be cases where the text within an entity's field contains vectors. Under normal conditions, the Vectoran engine will parse out these vectors before returning the text. In the event that you do not want the vectors parsed, use the parse=false option. An example of this is show in the examples section.

Examples

{{entity:home.1.address}}
This vector would return the address of the home record with id of 1.

{{entity:home.address}}
This vector would be used within repetition ({{repeat}} or {{paging}} vectors). This vector would not work outside of repetition.

{{entity:home.community.name}} This vector demonstrates how the foreign key relationships work. In this example, there are two tables: home and community. The community field on the home table points to a record in the community table. With this example, we are able to get the name of the community assigned to the home.

<img src="{{entity:home.1.floor_plan}}"/>
This demonstrates how to display the floor_plan image uploaded to the home.

{{entity:home.1.description|parse=false}}
This example shows how you can prevent the Vectoran engine from parsing any vectors that appear in the description field on the home table.