Skip to content

Commit

Permalink
Merge pull request #55 from AlexaCRM/TwigUpdates
Browse files Browse the repository at this point in the history
update functions for file_url and image_url
  • Loading branch information
georged authored Jan 22, 2024
2 parents eb04fdc + 2a1dc1f commit c7303fc
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions integration-cds/twig.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,29 @@ Dataverse Integration provides several Dataverse-specific and general purpose Tw

## Functions

- `image_url( record, imageColumn, isThumb = false )` -- returns URL to the image stored in the specified Dataverse image column. A thumbnail instead of a full image can be requested by setting `isThumb` parameter to `true`.
- `file_url( record, fileColumn )` -- returns download URL for the file stored in the specified Dataverse file column.
- image_url(
record,
column,
isThumb,
{
"Content-Disposition": "inline",
"Content-Type": "text/html; charset=utf-8",
"Cache-Control": "max-age=604800"
}
) -- returns URL to the image stored in the specified Dataverse image column.

- file_url(
record,
column,
{
"Content-Disposition": "inline",
"Content-Type": "text/html; charset=utf-8",
"Cache-Control": "max-age=604800"
}
) -- returns download URL for the file stored in the specified Dataverse file column.

- `last_error()` - returns last error generated by the Twig provider.

- `entity_url( record, postId = null )` -- {% include icds_premium.html %} returns URL to the website page with the given entity record bound to it. Uses [Table Binding](../table-binding/) feature. If more than one WordPress post is bound to the table, you can pass post ID to link to a different page instead.

## Templates usage
Expand Down

0 comments on commit c7303fc

Please sign in to comment.