This module adds template blocks, functions and modifiers for a Ride application to Smarty.
Parse block content if the specified route/url/permission is allowed.
Parameter | Type | Description |
---|---|---|
route | String | Path to check for allowance. |
url | String | URL to check for allowance. |
permission | String | Permission code to check for allowance. |
strategy | String | AND or OR when checking more then one of the above checks. |
var | String | Variable to assign the result to. (true if this block content will be printed, false otherwise) |
{isGranted permission="cms.node.varnish.manage"}
...
{/isGranted}
Note: The content of this block is always rendered. If the content is used for logic, assign the grant to a var and use an if statement.
Parse block content if the specified route/url/permission is not allowed.
Parameter | Type | Description |
---|---|---|
route | String | Path to check for allowance. |
url | String | URL to check for allowance. |
permission | String | Permission code to check for allowance. |
strategy | String | AND or OR when checking more then one of the above checks. |
var | String | Variable to assign the result to. (true if this block content will be printed, false otherwise) |
{isNotGranted permission="cms.node.varnish.manage"}
...
{/isNotGranted}
Note: The content of this block is always rendered. If the content is used for logic, assign the grant to a var and use an if statement.
{apiMethodParameters method= url= namespace= classes=}
{apiType type= url= method= html= link= namespace= classes=}
Return the URL of a transformed image.
Parameter | Type | Description |
---|---|---|
src | String | Source url or file for this image. |
default | String | Fallback for src parameter. |
transformation | String | Name of the transformation. |
var | String | Variable name to assign this URL to. |
thumbnail | --- | Deprecated |
For more information about the transformations and their parameters, check out ride-lib-image.
{image src=$content->image var='image' transformation='crop'}
Adds parsley data attributes to the attributes of a form widget.
Parameter | Type | Description |
---|---|---|
type | string | Type of the form row widget |
validators | Array | Validators of a form row |
var | String | Variable name to assign the updated attributes to. |
{$widget = $formRow->getWidget()}
{parsleyAttributes attributes=$widget->getAttributes() type=$widget->getType() var="attributes"}
Add these FormTable variables to the template:
$tableNameField
$tableActionField
$tableIdField
$tableOrderField
$tableSearchQueryField
$tablePageRowsField
{tableVars}
Translate a key using the i18n translator.
Parameter | Type | Description |
---|---|---|
key | String | Translation key. |
locale | String | Translation locale. |
n | Integer | Number of items for a translation that describes multiple items. |
var | String | Variable name to assign the translated key to. |
{translate key='label.submit' locale='nl'}
{$key|translate}
modifier syntax is preferred.
Create an URL.
Parameter | Type | Description |
---|---|---|
id | String | Route ID. |
parameters | Array | Path arguments for the URL. |
query | Array | Query parameters. |
separator | String | Seperator for query parameters. (defaults to & ) |
var | String | Variable name to assign the URL to. |
object | Boolean | Return URL Object instead of String. (defaults to false ) |
{url id='api.search' var='searchUrl'}
Parameter | Type | Description |
---|---|---|
String | ID of the decorator. |
Common decorator IDs: storage.size
/ time
/ date.format
/ file
/ file.extension
/ file.size
{$content->data->getDatePublished()|decorate:'time'}
Modify a string value to safely use it as a file name, URL, id etc.
{'Unsafe string!'|safe} {* result: unsafe-string *}
Parameter | Type | Description |
---|---|---|
Array | Variables to be replaced in the translation. |
{'label.fields.required'|translate}
- ride/app
- ride/app-image
- ride/app-template
- ride/app-template-smarty
- ride/lib-api
- ride/lib-image
- ride/lib-i18n
- ride/lib-router
- ride/lib-security
- ride/lib-template
- ride/lib-template-smarty
- ride/web
- ride/web-api
- ride/web-security
- ride/web-template
You can use Composer to install this application.
composer require ride/web-template-smarty