Fieldtypes
Fieldtypes in Coilpack are designed to provide a similar and consistent experience across all templating engines. The ExpressionEngine documentation provides more detail on how Fieldtypes behave natively while this documentation should help you understand how they can be used in Twig and Blade templates.
Certain parameters or modifiers may behave differently in Coilpack or may not be available at all. We will try to call attention to these special cases.
Basic Syntax
- Twig
- Blade
{# Field #}
{{ entry.field_name }}
{# Field with parameters #}
{{ entry.field_name.parameters({name: "value"}) }}
{# Modifier #}
{{ entry.field_name.modifier_name() }}
{# Modifier with parameters #}
{{ entry.field_name.modifier_name({parameter_name: "value"}) }}
{# Chaining Modifiers #}
{{ entry.field_name.modifier_name({parameter_name: "value"}).another_modifier() }}
{{-- Field --}}
{{ $entry->field_name }}
{{-- Field with parameters --}}
{{ $entry->field_name->parameters(['name' => "value"]) }}
{{-- Modifier --}}
{{ $entry->field_name->modifier_name() }}
{{-- Modifier with parameters --}}
{{ $entry->field_name->modifier_name(['parameter_name' => "value"]) }}
{{-- Chaining Modifiers --}}
{{ $entry->field_name->modifier_name(['parameter_name' => "value"]).another_modifier() }}
Rendering HTML
Both Twig and Blade default to escaping HTML on output to prevent potential security issues. If you have a fieldtype or modifier that is rendering HTML you will need to change how they are output slightly to render the HTML properly.
- Twig
- Blade
{{ entry.field_name | raw }}
{!! $entry->field_name !!}